Module: HashSyntax::Transformer
Constant Summary collapse
- MATCH_18 =
ObjectRegex.new('symbeg (ident | kw) sp? hashrocket')
- MATCH_19 =
ObjectRegex.new('label')
Instance Method Summary collapse
Instance Method Details
#transform(input_text, options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hash_syntax/transformer.rb', line 8 def transform(input_text, ) tokens = extract_tokens(input_text) if [:"to-18"] transform_to_18(input_text, tokens, ) elsif [:"to-19"] transform_to_19(input_text, tokens, ) else raise ArgumentError.new('Either :to_18 or :to_19 must be specified.') end end |