Module: Clamp::Parameter::Declaration

Includes:
Attribute::Declaration
Included in:
Command
Defined in:
lib/clamp/parameter/declaration.rb

Instance Method Summary collapse

Instance Method Details

#has_parameters?Boolean

Returns:

  • (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, options = {}, &block)
  Parameter::Definition.new(name, description, options).tap do |parameter|
    parameters << parameter
    define_accessors_for(parameter, &block)
  end
end

#parametersObject



11
12
13
# File 'lib/clamp/parameter/declaration.rb', line 11

def parameters
  @parameters ||= []
end