Class: Typhoid::Parser

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_string) ⇒ Parser

Returns a new instance of Parser.



9
10
11
# File 'lib/typhoid/parser.rb', line 9

def initialize(json_string)
  @json_string = json_string
end

Instance Attribute Details

#json_stringObject (readonly)

Returns the value of attribute json_string.



3
4
5
# File 'lib/typhoid/parser.rb', line 3

def json_string
  @json_string
end

Class Method Details

.call(json_string) ⇒ Object



5
6
7
# File 'lib/typhoid/parser.rb', line 5

def self.call(json_string)
  new(json_string).parse
end

Instance Method Details

#parseObject



13
14
15
# File 'lib/typhoid/parser.rb', line 13

def parse
  parsed_body
end