Class: EacRubyUtils::ArgumentsConsumer
- Defined in:
- lib/eac_ruby_utils/arguments_consumer.rb
Defined Under Namespace
Classes: InvalidArgumentError, Parser
Instance Attribute Summary collapse
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
#positional ⇒ Object
readonly
Returns the value of attribute positional.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(positional, default_options) ⇒ ArgumentsConsumer
constructor
A new instance of ArgumentsConsumer.
- #parse(args) ⇒ Object
Constructor Details
#initialize(positional, default_options) ⇒ ArgumentsConsumer
Returns a new instance of ArgumentsConsumer.
15 16 17 18 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 15 def initialize(positional, ) @positional = positional.dup.freeze @default_options = .dup.freeze end |
Instance Attribute Details
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
13 14 15 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 13 def @default_options end |
#positional ⇒ Object (readonly)
Returns the value of attribute positional.
13 14 15 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 13 def positional @positional end |
Class Method Details
.parse(args, positional = [], options = {}) ⇒ Object
8 9 10 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 8 def parse(args, positional = [], = {}) new(args, positional, ).data end |