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.
16 17 18 19 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 16 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.
14 15 16 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 14 def @default_options end |
#positional ⇒ Object (readonly)
Returns the value of attribute positional.
14 15 16 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 14 def positional @positional end |
Class Method Details
.parse(args, positional = [], options = {}) ⇒ Object
9 10 11 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 9 def parse(args, positional = [], = {}) new(args, positional, ).data end |