Class: Phoenx::Cli::Option
- Inherits:
-
Object
- Object
- Phoenx::Cli::Option
- Defined in:
- lib/phoenx/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.
14 15 16 17 18 19 20 |
# File 'lib/phoenx/cli/option.rb', line 14 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.
9 10 11 |
# File 'lib/phoenx/cli/option.rb', line 9 def description @description end |
#has_argument ⇒ Object
Returns the value of attribute has_argument.
10 11 12 |
# File 'lib/phoenx/cli/option.rb', line 10 def has_argument @has_argument end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/phoenx/cli/option.rb', line 7 def name @name end |
#short_cut ⇒ Object
Returns the value of attribute short_cut.
8 9 10 |
# File 'lib/phoenx/cli/option.rb', line 8 def short_cut @short_cut end |
Instance Method Details
#execute ⇒ Object
22 23 24 |
# File 'lib/phoenx/cli/option.rb', line 22 def execute @block.call end |