Class: Shb::Parser

Inherits:
HTTParty::Parser
  • Object
show all
Defined in:
lib/shb/parser.rb

Instance Method Summary collapse

Instance Method Details

#htmlObject



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

def html
  Nokogiri::HTML(body)
end

#jsonObject



21
22
23
24
25
# File 'lib/shb/parser.rb', line 21

def json
  JSON.parse(body)
rescue JSON::ParserError
  nil
end

#xmlObject



17
18
19
# File 'lib/shb/parser.rb', line 17

def xml
  Nokogiri::XML(body)
end