Class: Podage::Option
- Inherits:
-
Object
- Object
- Podage::Option
- Defined in:
- lib/podage/cli/option.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#has_argument ⇒ Object
Returns the value of attribute has_argument.
-
#name ⇒ Object
Returns the value of attribute name.
-
#short_cut ⇒ Object
Returns the value of attribute short_cut.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, short_cut, description, has_argument, &block) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(name, short_cut, description, has_argument, &block) ⇒ Option
Returns a new instance of Option.
35 36 37 38 39 40 41 42 43 |
# File 'lib/podage/cli/option.rb', line 35 def initialize(name, short_cut, description, has_argument, &block) @name = name @short_cut = short_cut @description = description @has_argument = has_argument @block = block end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
30 31 32 |
# File 'lib/podage/cli/option.rb', line 30 def description @description end |
#has_argument ⇒ Object
Returns the value of attribute has_argument.
31 32 33 |
# File 'lib/podage/cli/option.rb', line 31 def has_argument @has_argument end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/podage/cli/option.rb', line 28 def name @name end |
#short_cut ⇒ Object
Returns the value of attribute short_cut.
29 30 31 |
# File 'lib/podage/cli/option.rb', line 29 def short_cut @short_cut end |
Instance Method Details
#execute ⇒ Object
45 46 47 48 49 |
# File 'lib/podage/cli/option.rb', line 45 def execute @block.call end |