Class: BootstrapBuilders::ArgumentsParser
- Inherits:
-
Object
- Object
- BootstrapBuilders::ArgumentsParser
- Defined in:
- lib/bootstrap_builders/arguments_parser.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#arguments_hash ⇒ Object
readonly
Returns the value of attribute arguments_hash.
Instance Method Summary collapse
-
#initialize(args) ⇒ ArgumentsParser
constructor
A new instance of ArgumentsParser.
Constructor Details
#initialize(args) ⇒ ArgumentsParser
Returns a new instance of ArgumentsParser.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bootstrap_builders/arguments_parser.rb', line 4 def initialize(args) @arguments = args.fetch(:arguments) if args[:argument_hash_default] @arguments_hash = args.fetch(:argument_hash_default) else @arguments_hash = {} end @arguments_hash = @arguments_hash.merge(@arguments.pop) if @arguments.last.is_a?(Hash) @arguments << @arguments_hash @short_true_arguments = args[:short_true_arguments] parse_short_true_arguments if @short_true_arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
2 3 4 |
# File 'lib/bootstrap_builders/arguments_parser.rb', line 2 def arguments @arguments end |
#arguments_hash ⇒ Object (readonly)
Returns the value of attribute arguments_hash.
2 3 4 |
# File 'lib/bootstrap_builders/arguments_parser.rb', line 2 def arguments_hash @arguments_hash end |