Module: CodeMiner::HashProcessor
- Included in:
- Parser
- Defined in:
- lib/codeminer/processors/hash_processor.rb
Instance Method Summary collapse
- #on_assoc_new(key, value) ⇒ Object
- #on_assoclist_from_args(pairs) ⇒ Object
- #on_bare_assoc_hash(pairs) ⇒ Object
- #on_hash(pairs) ⇒ Object
- #on_label(value) ⇒ Object
Instance Method Details
#on_assoc_new(key, value) ⇒ Object
17 18 19 |
# File 'lib/codeminer/processors/hash_processor.rb', line 17 def on_assoc_new(key, value) HashPairExpression.new(key, value, extract_src_by_token(key, value.end_line, value.end_column)) end |
#on_assoclist_from_args(pairs) ⇒ Object
13 14 15 |
# File 'lib/codeminer/processors/hash_processor.rb', line 13 def on_assoclist_from_args(pairs) pairs end |
#on_bare_assoc_hash(pairs) ⇒ Object
9 10 11 |
# File 'lib/codeminer/processors/hash_processor.rb', line 9 def (pairs) HashExpression.new(pairs.to_a, extract_src_by_tokens(pairs.first, pairs.last)) end |
#on_hash(pairs) ⇒ Object
5 6 7 |
# File 'lib/codeminer/processors/hash_processor.rb', line 5 def on_hash(pairs) HashExpression.new(pairs.to_a, extract_src_by_token(@lbrace.pop)) end |
#on_label(value) ⇒ Object
21 22 23 |
# File 'lib/codeminer/processors/hash_processor.rb', line 21 def on_label(value) Token.new(:symbol, value.chomp(':'), extract_src_by_value(value)) end |