Class: EacRubyUtils::ArgumentsConsumer::Parser
- Defined in:
- lib/eac_ruby_utils/arguments_consumer.rb
Instance Attribute Summary collapse
-
#arguments_consumer ⇒ Object
readonly
Returns the value of attribute arguments_consumer.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(arguments_consumer, args) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(arguments_consumer, args) ⇒ Parser
Returns a new instance of Parser.
27 28 29 30 31 32 33 34 35 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 27 def initialize(arguments_consumer, args) @arguments_consumer = arguments_consumer @data = ::ActiveSupport::HashWithIndifferentAccess.new @options_found = false arguments_consumer.positional.each { |key| data[key] = nil } data.merge!(arguments_consumer.) args.each_with_index { |value, index| add_arg(value, index) } data.freeze end |
Instance Attribute Details
#arguments_consumer ⇒ Object (readonly)
Returns the value of attribute arguments_consumer.
25 26 27 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 25 def arguments_consumer @arguments_consumer end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
25 26 27 |
# File 'lib/eac_ruby_utils/arguments_consumer.rb', line 25 def data @data end |