Class: FerretsOnFire::Command
- Inherits:
-
Object
- Object
- FerretsOnFire::Command
- Defined in:
- lib/ferrets_on_fire/command.rb
Instance Attribute Summary collapse
-
#action_block ⇒ Object
readonly
Returns the value of attribute action_block.
-
#args ⇒ Object
Returns the value of attribute args.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#global_options ⇒ Object
Returns the value of attribute global_options.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #action(&block) ⇒ Object
-
#initialize(name, desc, default, &block) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(name, desc, default, &block) ⇒ Command
Returns a new instance of Command.
7 8 9 10 11 12 13 14 |
# File 'lib/ferrets_on_fire/command.rb', line 7 public def initialize(name, desc, default, &block) @name = name.to_sym @desc = desc @default = default define_singleton_method(:dispatch, block) dispatch end |
Instance Attribute Details
#action_block ⇒ Object (readonly)
Returns the value of attribute action_block.
4 5 6 |
# File 'lib/ferrets_on_fire/command.rb', line 4 def action_block @action_block end |
#args ⇒ Object
Returns the value of attribute args.
5 6 7 |
# File 'lib/ferrets_on_fire/command.rb', line 5 def args @args end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
4 5 6 |
# File 'lib/ferrets_on_fire/command.rb', line 4 def default @default end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
4 5 6 |
# File 'lib/ferrets_on_fire/command.rb', line 4 def desc @desc end |
#global_options ⇒ Object
Returns the value of attribute global_options.
5 6 7 |
# File 'lib/ferrets_on_fire/command.rb', line 5 def @global_options end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ferrets_on_fire/command.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/ferrets_on_fire/command.rb', line 5 def @options end |
Instance Method Details
#action(&block) ⇒ Object
16 17 18 |
# File 'lib/ferrets_on_fire/command.rb', line 16 public def action(&block) @action_block = block end |