Class: Alephant::Support::Parser
- Inherits:
-
Object
- Object
- Alephant::Support::Parser
- Defined in:
- lib/alephant/support/parser.rb
Instance Attribute Summary collapse
-
#vary_lookup ⇒ Object
readonly
Returns the value of attribute vary_lookup.
Instance Method Summary collapse
-
#initialize(vary_jsonpath = nil) ⇒ Parser
constructor
A new instance of Parser.
- #parse(msg) ⇒ Object
Constructor Details
#initialize(vary_jsonpath = nil) ⇒ Parser
Returns a new instance of Parser.
9 10 11 |
# File 'lib/alephant/support/parser.rb', line 9 def initialize(vary_jsonpath = nil) @vary_lookup = vary_jsonpath ? JsonPathLookup.new(vary_jsonpath) : nil end |
Instance Attribute Details
#vary_lookup ⇒ Object (readonly)
Returns the value of attribute vary_lookup.
7 8 9 |
# File 'lib/alephant/support/parser.rb', line 7 def vary_lookup @vary_lookup end |
Instance Method Details
#parse(msg) ⇒ Object
13 14 15 |
# File 'lib/alephant/support/parser.rb', line 13 def parse(msg) symbolize(msg.body).tap { |o| o[:options] = msg unless not o[:options].nil? } end |