Class: Thor::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/thor/option.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  options[:required] = false unless options.key?(:required)
  super
  @lazy_default = options[:lazy_default]
  @group        = options[:group].to_s.capitalize if options[:group]
  @aliases      = Array(options[:aliases])
  @hide         = options[:hide]
  @validator    = options[:validator]
end

Instance Attribute Details

#validatorObject (readonly)

Returns the value of attribute validator.



3
4
5
# File 'lib/ext/thor/option.rb', line 3

def validator
  @validator
end