Sha256: b261c12615e9be85d73bfb9b2117ce380dbdba96d4fad38b4fe3f6ece03fbddf
Contents?: true
Size: 778 Bytes
Versions: 15
Compression:
Stored size: 778 Bytes
Contents
# Only allow this backend the json gem is already loaded raise LoadError, "The json library isn't available. require 'json'" unless Object.const_defined?('JSON') module OEmbed module Formatter module JSON module Backends module JSONGem extend self # Parses a JSON string or IO and convert it into an object. def decode(json) if json.respond_to?(:read) json = json.read end ::JSON.parse(json) end def decode_fail_msg "The version of the json library you have installed isn't parsing JSON like ruby-oembed expected." end def parse_error ::JSON::ParserError end end end end end end
Version data entries
15 entries across 15 versions & 2 rubygems