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
21 22 23 |
# File 'lib/clamp/option/declaration.rb', line 21 def @declared_options ||= [] end |
#find_option(switch) ⇒ Object
17 18 19 |
# File 'lib/clamp/option/declaration.rb', line 17 def find_option(switch) .find { |o| o.handles?(switch) } end |
#option(switches, type, description, opts = {}, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/clamp/option/declaration.rb', line 11 def option(switches, type, description, opts = {}, &block) option = Clamp::Option.new(switches, type, description, opts) << option define_accessors_for(option, &block) end |
#recognised_options ⇒ Object
25 26 27 28 |
# File 'lib/clamp/option/declaration.rb', line 25 def end |