Module: Ruby::Alternation::ArgsList
- Included in:
- Ruby::ArgsList
- Defined in:
- lib/ruby/alternation/args.rb
Instance Method Summary collapse
Instance Method Details
#options ⇒ Object
4 5 6 |
# File 'lib/ruby/alternation/args.rb', line 4 def last.arg.is_a?(Ruby::Hash) ? last : nil end |
#set_option(key, value) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ruby/alternation/args.rb', line 8 def set_option(key, value) if .nil? # TODO gotta add a separator as well, so maybe better replace the whole options hash self << to_node({key => value}, position.tap { |p| p[1] += length }) else [key] = to_node(value, [key].position, [key].prolog) end end |