123456789_123456789_123456789_123456789_123456789_

Class: IRB::Command::Base

Do not use. This class is for internal use only.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(irb_context) ⇒ Base

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 49

def initialize(irb_context)
  @irb_context = irb_context
end

Class Method Details

.category(category = nil)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 21

def category(category = nil)
  @category = category if category
  @category || "No category"
end

.description(description = nil)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 26

def description(description = nil)
  @description = description if description
  @description || "No description provided."
end

.execute(irb_context, arg)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 36

def execute(irb_context, arg)
  new(irb_context).execute(arg)
rescue CommandArgumentError => e
  puts e.message
end

.help_message(help_message = nil)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 31

def help_message(help_message = nil)
  @help_message = help_message if help_message
  @help_message
end

.highlight(text) (private)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 44

def highlight(text)
  Color.colorize(text, [:BOLD, :BLUE])
end

Instance Attribute Details

#irb_context (readonly)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 53

attr_reader :irb_context

Instance Method Details

#execute(arg)

[ GitHub ]

  
# File 'lib/irb/command/base.rb', line 55

def execute(arg)
  #nop
end