Sha256: 6a6f6e9206aa54b0779d7c770f6db1538b711a987053ab8d1b2b2a83a98d9826

Contents?: true

Size: 362 Bytes

Versions: 25

Compression:

Stored size: 362 Bytes

Contents

module JsonApiClient
  module Query
    class Find < Base
      self.request_method = :get

      def build_params(args)
        @params = case args
        when Hash
          args
        when Array
          {klass.primary_key.to_s.pluralize.to_sym => args.join(",")}
        else
          {klass.primary_key => args}
        end
      end

    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
json_api_client-0.9.6 lib/json_api_client/query/find.rb
json_api_client-0.9.5 lib/json_api_client/query/find.rb
json_api_client-0.9.4 lib/json_api_client/query/find.rb
json_api_client-0.9.3 lib/json_api_client/query/find.rb
json_api_client-0.9.2 lib/json_api_client/query/find.rb
json_api_client-0.9.0 lib/json_api_client/query/find.rb
json_api_client-0.8.1 lib/json_api_client/query/find.rb
json_api_client-0.8.0 lib/json_api_client/query/find.rb
json_api_client-0.7.1 lib/json_api_client/query/find.rb
json_api_client-0.7.0 lib/json_api_client/query/find.rb
json_api_client-0.6.0 lib/json_api_client/query/find.rb
json_api_client-0.5.1 lib/json_api_client/query/find.rb
json_api_client-0.5.0 lib/json_api_client/query/find.rb
json_api_client-0.4.0 lib/json_api_client/query/find.rb
json_api_client-0.3.1 lib/json_api_client/query/find.rb
json_api_client-0.3.0 lib/json_api_client/query/find.rb
json_api_client-0.2.4 lib/json_api_client/query/find.rb
json_api_client-0.2.3 lib/json_api_client/query/find.rb
json_api_client-0.2.2 lib/json_api_client/query/find.rb
json_api_client-0.2.1 lib/json_api_client/query/find.rb