Sha256: 55fc91ee9f1ade25869f578be9e18e86a6646168e0f98d25f4d3356cd721f501

Contents?: true

Size: 311 Bytes

Versions: 8

Compression:

Stored size: 311 Bytes

Contents

# frozen_string_literal: true

require "json"

module LiteCable
  module Coders
    # Wrapper over JSON
    module JSON
      class << self
        def decode(json_str)
          ::JSON.parse(json_str)
        end

        def encode(ruby_obj)
          ruby_obj.to_json
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
litecable-0.8.2 lib/lite_cable/coders/json.rb
litecable-0.8.1 lib/lite_cable/coders/json.rb
litecable-0.8.0 lib/lite_cable/coders/json.rb
litecable-0.7.2 lib/lite_cable/coders/json.rb
litecable-0.7.1 lib/lite_cable/coders/json.rb
litecable-0.7.0 lib/lite_cable/coders/json.rb
litecable-0.6.0 lib/lite_cable/coders/json.rb
litecable-0.5.0 lib/lite_cable/coders/json.rb