Module: OEmbed::Formatter::JSON::Backends::JSONGem
Constant Summary collapse
- ParseError =
::JSON::ParserError
Instance Method Summary collapse
-
#decode(json) ⇒ Object
Parses a JSON string or IO and convert it into an object.
Instance Method Details
#decode(json) ⇒ Object
Parses a JSON string or IO and convert it into an object.
13 14 15 16 17 18 |
# File 'lib/oembed/formatter/json/backends/jsongem.rb', line 13 def decode(json) if json.respond_to?(:read) json = json.read end ::JSON.parse(json) end |