Class: Unitwise::Expression::Parser

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/unitwise/expression/parser.rb

Overview

Parses a string expression into a hash tree representing the expression's terms, prefixes, and atoms.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key = :primary_code) ⇒ Parser



7
8
9
# File 'lib/unitwise/expression/parser.rb', line 7

def initialize(key = :primary_code)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key



6
7
8
# File 'lib/unitwise/expression/parser.rb', line 6

def key
  @key
end