Class: Baloo::Parser
- Inherits:
-
HTTParty::Parser
- Object
- HTTParty::Parser
- Baloo::Parser
- Defined in:
- lib/baloo/parser.rb
Instance Method Summary collapse
Instance Method Details
#bool ⇒ Object
19 20 21 |
# File 'lib/baloo/parser.rb', line 19 def bool body =~ /^true$/ ? true : false end |
#json ⇒ Object
15 16 17 |
# File 'lib/baloo/parser.rb', line 15 def json Yajl::Parser.parse(body) end |
#parse ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/baloo/parser.rb', line 5 def parse if /^true|false$/.match(body) bool elsif /^\{|\[.+\}|\]$/.match(body) json else body end end |