Module: Clamp::Parameter::Declaration
- Includes:
- Attribute::Declaration
- Included in:
- Command
- Defined in:
- lib/clamp/parameter/declaration.rb
Instance Method Summary collapse
- #has_parameters? ⇒ Boolean
- #parameter(name, description, options = {}, &block) ⇒ Object
- #parameters ⇒ Object
Instance Method Details
#has_parameters? ⇒ Boolean
15 16 17 |
# File 'lib/clamp/parameter/declaration.rb', line 15 def has_parameters? !parameters.empty? end |
#parameter(name, description, options = {}, &block) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/clamp/parameter/declaration.rb', line 19 def parameter(name, description, = {}, &block) Parameter::Definition.new(name, description, ).tap do |parameter| parameters << parameter define_accessors_for(parameter, &block) end end |
#parameters ⇒ Object
11 12 13 |
# File 'lib/clamp/parameter/declaration.rb', line 11 def parameters @parameters ||= [] end |