Class: Alephant::Support::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/support/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_lookupObject (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] = options_for msg unless not o[:options].nil? }
end