Class: Baptize::Command
- Inherits:
-
Object
- Object
- Baptize::Command
- Defined in:
- lib/baptize/application.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, description = nil, &block) ⇒ Command
constructor
A new instance of Command.
- #invoke(*args) ⇒ Object
Constructor Details
#initialize(name, description = nil, &block) ⇒ Command
Returns a new instance of Command.
13 14 15 |
# File 'lib/baptize/application.rb', line 13 def initialize(name, description=nil, &block) @name, @description, @block = name.to_sym, description, block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/baptize/application.rb', line 11 def block @block end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/baptize/application.rb', line 11 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/baptize/application.rb', line 11 def name @name end |
Instance Method Details
#invoke(*args) ⇒ Object
17 18 19 |
# File 'lib/baptize/application.rb', line 17 def invoke(*args) block.call(*args) end |