Class: Command::ArgumentDecoration

Inherits:
Argument
  • Object
show all
Defined in:
lib/command-set/arguments.rb

Direct Known Subclasses

Named, Optional, Repeating

Instance Attribute Summary

Attributes inherited from Argument

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Argument

#basis, #check_present, #complete, #consume, #consume_hash, #match_terms, #names, #omittable?, #parse, #required?, #subject_requirements, #validate

Constructor Details

#initialize(up, down) ⇒ ArgumentDecoration

Returns a new instance of ArgumentDecoration.



146
147
148
149
# File 'lib/command-set/arguments.rb', line 146

def initialize(up, down)
  @wrapping_decorator = up
  @decorated = down
end

Class Method Details

.register(name) ⇒ Object Also known as: register_as



128
129
130
# File 'lib/command-set/arguments.rb', line 128

def register(name)
  DSL::Argument::register_decorator(self, name)
end

Instance Method Details

#decoratedObject



151
152
153
# File 'lib/command-set/arguments.rb', line 151

def decorated
  @decorated
end

#pretty_print_instance_variablesObject



142
143
144
# File 'lib/command-set/arguments.rb', line 142

def pretty_print_instance_variables
  ["@decorated"]
end