Class: Lab419::Options::Parser
- Inherits:
-
Object
- Object
- Lab419::Options::Parser
- Defined in:
- lib/lab419/options/parser.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#kwds ⇒ Object
Returns the value of attribute kwds.
-
#positionals ⇒ Object
Returns the value of attribute positionals.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/lab419/options/parser.rb', line 4 def data @data end |
#kwds ⇒ Object
Returns the value of attribute kwds.
4 5 6 |
# File 'lib/lab419/options/parser.rb', line 4 def kwds @kwds end |
#positionals ⇒ Object
Returns the value of attribute positionals.
4 5 6 |
# File 'lib/lab419/options/parser.rb', line 4 def positionals @positionals end |
Instance Method Details
#parse(args) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/lab419/options/parser.rb', line 5 def parse args self.data = {to_a: args} self.kwds = {} self.positionals = [] parse_all args data.merge kwds: OpenStruct.new(kwds), args: positionals end |