Module: Clamp::Option::Declaration
Instance Method Summary collapse
- #declared_options ⇒ Object
- #find_option(switch) ⇒ Object
- #option(switches, type, description, opts = {}, &block) ⇒ Object
- #recognised_options ⇒ Object
Instance Method Details
#declared_options ⇒ Object
23 24 25 |
# File 'lib/clamp/option/declaration.rb', line 23 def @declared_options ||= [] end |
#find_option(switch) ⇒ Object
19 20 21 |
# File 'lib/clamp/option/declaration.rb', line 19 def find_option(switch) .find { |o| o.handles?(switch) } end |
#option(switches, type, description, opts = {}, &block) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/clamp/option/declaration.rb', line 11 def option(switches, type, description, opts = {}, &block) Option::Definition.new(switches, type, description, opts).tap do |option| << option block ||= option.default_conversion_block define_accessors_for(option, &block) end end |
#recognised_options ⇒ Object
27 28 29 30 |
# File 'lib/clamp/option/declaration.rb', line 27 def end |