Parent

Clamp::Parameter::Definition

Attributes

name[R]

Public Class Methods

new(name, description, options = {}) click to toggle source
# File lib/clamp/parameter/definition.rb, line 8
def initialize(name, description, options = {})
  @name = name
  @description = description
  super(options)
  @multivalued = (@name =~ ELLIPSIS_SUFFIX)
  @required = options.fetch(:required) do
    (@name !~ OPTIONAL)
  end
end

Public Instance Methods

consume(arguments) click to toggle source
# File lib/clamp/parameter/definition.rb, line 24
def consume(arguments)
  raise ArgumentError, Clamp.message(:no_value_provided) if required? && arguments.empty?
  arguments.shift(multivalued? ? arguments.length : 1)
end
help_lhs() click to toggle source
# File lib/clamp/parameter/definition.rb, line 20
def help_lhs
  name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.