Class: IRB::Command::Base
- Inherits:
-
Object
- Object
- IRB::Command::Base
- Defined in:
- lib/irb/command/base.rb
Instance Attribute Summary collapse
-
#irb_context ⇒ Object
readonly
Returns the value of attribute irb_context.
Class Method Summary collapse
- .category(category = nil) ⇒ Object
- .description(description = nil) ⇒ Object
- .execute(irb_context, arg) ⇒ Object
- .help_message(help_message = nil) ⇒ Object
Instance Method Summary collapse
- #execute(arg) ⇒ Object
-
#initialize(irb_context) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(irb_context) ⇒ Base
Returns a new instance of Base.
47 48 49 |
# File 'lib/irb/command/base.rb', line 47 def initialize(irb_context) @irb_context = irb_context end |
Instance Attribute Details
#irb_context ⇒ Object (readonly)
Returns the value of attribute irb_context.
51 52 53 |
# File 'lib/irb/command/base.rb', line 51 def irb_context @irb_context end |
Class Method Details
.category(category = nil) ⇒ Object
19 20 21 22 |
# File 'lib/irb/command/base.rb', line 19 def category(category = nil) @category = category if category @category || "No category" end |
.description(description = nil) ⇒ Object
24 25 26 27 |
# File 'lib/irb/command/base.rb', line 24 def description(description = nil) @description = description if description @description || "No description provided." end |
.execute(irb_context, arg) ⇒ Object
34 35 36 37 38 |
# File 'lib/irb/command/base.rb', line 34 def execute(irb_context, arg) new(irb_context).execute(arg) rescue CommandArgumentError => e puts e. end |
.help_message(help_message = nil) ⇒ Object
29 30 31 32 |
# File 'lib/irb/command/base.rb', line 29 def ( = nil) @help_message = if @help_message end |
Instance Method Details
#execute(arg) ⇒ Object
53 54 55 |
# File 'lib/irb/command/base.rb', line 53 def execute(arg) #nop end |