Sha256: 1f09f98ef02a2246d9be9f5fc5841d8fcd78953d0de508d0f977810ad386efac

Contents?: true

Size: 790 Bytes

Versions: 25

Compression:

Stored size: 790 Bytes

Contents

# Only allow this backend if ActiveSupport::JSON is already loaded
raise LoadError, "ActiveSupport::JSON isn't available. require 'activesupport/json'" unless defined?(ActiveSupport::JSON)

module OEmbed
  module Formatter
    module JSON
      module Backends
        module ActiveSupportJSON
          extend self

          # Parses a JSON string or IO and convert it into an object.
          def decode(json)
            ::ActiveSupport::JSON.decode(json)
          end
          
          def decode_fail_msg
            "The version of ActiveSupport::JSON you have installed isn't parsing JSON like ruby-oembed expected."
          end
          
          def parse_error
            ::ActiveSupport::JSON.parse_error
          end
        
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
ruby-oembed-0.18.0 lib/oembed/formatter/json/backends/activesupportjson.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-oembed-0.17.0/lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.17.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.16.1 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.16.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.15.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.14.1 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.14.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.13.1 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.13.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.12.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.11.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.10.1 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.10.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.9.0 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.8.14 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.8.13 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.8.12 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.8.11 lib/oembed/formatter/json/backends/activesupportjson.rb
ruby-oembed-0.8.10 lib/oembed/formatter/json/backends/activesupportjson.rb