Sha256: c24cca4804b3307e768155eaa9bf180e855390b06488934713e179c87564a2ff
Contents?: true
Size: 742 Bytes
Versions: 7
Compression:
Stored size: 742 Bytes
Contents
module JsonApiClient module Query class Base class_attribute :request_method attr_reader :klass, :headers, :path, :params def initialize(klass, args) @klass = klass build_params(args) @headers = klass.default_headers.dup @path = begin p = klass.path(@params) if @params.has_key?(klass.primary_key) && !@params[klass.primary_key].is_a?(Array) p = File.join(p, @params.delete(klass.primary_key).to_s) end p end end def build_params(args) @params = args.dup end def inspect "method: #{request_method}; path: #{path}; params: #{params}, headers: #{headers}" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems