Class: Thor::Option
- Inherits:
-
Object
- Object
- Thor::Option
- Defined in:
- lib/ext/thor/option.rb
Instance Attribute Summary collapse
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(name, options = {}) ⇒ Option
Returns a new instance of Option.
5 6 7 8 9 10 11 12 13 |
# File 'lib/ext/thor/option.rb', line 5 def initialize(name, = {}) [:required] = false unless .key?(:required) super @lazy_default = [:lazy_default] @group = [:group].to_s.capitalize if [:group] @aliases = Array([:aliases]) @hide = [:hide] @validator = [:validator] end |
Instance Attribute Details
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
3 4 5 |
# File 'lib/ext/thor/option.rb', line 3 def validator @validator end |