Sha256: 866392c5a8f3e43e9252b3692059231f06b267db197a82612a97cfd10d164125

Contents?: true

Size: 342 Bytes

Versions: 6

Compression:

Stored size: 342 Bytes

Contents

# frozen_string_literal: true

class Serega
  module Utils
    class ToJSON
      class << self
        def call(data)
          json_adapter.dump(data)
        end

        private

        def json_adapter
          @json_adapter ||= begin
            require "json"
            ::JSON
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serega-0.1.5 lib/serega/utils/to_json.rb
serega-0.1.4 lib/serega/utils/to_json.rb
serega-0.1.3 lib/serega/utils/to_json.rb
serega-0.1.2 lib/serega/utils/to_json.rb
serega-0.1.1 lib/serega/utils/to_json.rb
serega-0.1.0 lib/serega/utils/to_json.rb