Sha256: 531a3035bddd8b285113c50b38f158cefa8a41a1dfe185ff250c40094751684a

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 Bytes

Contents

module Mrkt
  module Faraday
    class ParamsEncoder
      class << self
        def encode(hash)
          new_hash = hash.transform_values { |v| encode_value(v) }
          ::Faraday::NestedParamsEncoder.encode(new_hash)
        end

        def decode(string)
          ::Faraday::NestedParamsEncoder.decode(string)
        end

        def encode_value(value)
          value.respond_to?(:join) ? value.join(',') : value
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mrkt-1.2.2 lib/mrkt/faraday/params_encoder.rb
mrkt-1.2.1 lib/mrkt/faraday/params_encoder.rb
mrkt-1.2.0 lib/mrkt/faraday/params_encoder.rb
mrkt-1.1.1 lib/mrkt/faraday/params_encoder.rb
mrkt-1.1.0 lib/mrkt/faraday/params_encoder.rb
mrkt-1.0.1 lib/mrkt/faraday/params_encoder.rb