Sha256: ae4cc43223a161c97b55506a645d5b6634d0ba23a688a332c3338a92e32e1f18

Contents?: true

Size: 677 Bytes

Versions: 20

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

class Serega
  module SeregaJSON
    #
    # JSON dump adapter for ::JSON
    #
    class JSONDump
      #
      # Dumps data to JSON string
      #
      # @param data [Object] Anything
      #
      # @return [String] Data serialized to JSON
      #
      def self.call(data)
        ::JSON.dump(data)
      end
    end

    #
    # JSON parse adapter for ::JSON
    #
    class JSONLoad
      #
      # Loads object from JSON string
      #
      # @param json_string [String] JSON String
      #
      # @return [Object] Deserialized data
      #
      def self.call(json_string)
        ::JSON.parse(json_string)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
serega-0.21.0 lib/serega/json/json.rb
serega-0.20.1 lib/serega/json/json.rb
serega-0.20.0 lib/serega/json/json.rb
serega-0.19.0 lib/serega/json/json.rb
serega-0.18.0 lib/serega/json/json.rb
serega-0.17.0 lib/serega/json/json.rb
serega-0.16.0 lib/serega/json/json.rb
serega-0.15.0 lib/serega/json/json.rb
serega-0.14.0 lib/serega/json/json.rb
serega-0.12.0 lib/serega/json/json.rb
serega-0.11.2 lib/serega/json/json.rb
serega-0.11.1 lib/serega/json/json.rb
serega-0.11.0 lib/serega/json/json.rb
serega-0.10.0 lib/serega/json/json.rb
serega-0.9.0 lib/serega/json/json.rb
serega-0.8.3 lib/serega/json/json.rb
serega-0.8.2 lib/serega/json/json.rb
serega-0.8.1 lib/serega/json/json.rb
serega-0.8.0 lib/serega/json/json.rb
serega-0.7.0 lib/serega/json/json.rb