Module: OEmbed::Formatter::JSON::Backends::JSONGem
Instance Method Summary collapse
-
#decode(json) ⇒ Object
Parses a JSON string or IO and convert it into an object.
- #decode_fail_msg ⇒ Object
- #parse_error ⇒ Object
Instance Method Details
#decode(json) ⇒ Object
Parses a JSON string or IO and convert it into an object.
12 13 14 15 16 17 |
# File 'lib/oembed/formatter/json/backends/jsongem.rb', line 12 def decode(json) if json.respond_to?(:read) json = json.read end ::JSON.parse(json) end |
#decode_fail_msg ⇒ Object
19 20 21 |
# File 'lib/oembed/formatter/json/backends/jsongem.rb', line 19 def decode_fail_msg "The version of the json library you have installed isn't parsing JSON like ruby-oembed expected." end |
#parse_error ⇒ Object
23 24 25 |
# File 'lib/oembed/formatter/json/backends/jsongem.rb', line 23 def parse_error ::JSON::ParserError end |