Sha256: 46a740ff2f55f8c3b87c85843062d4590618baebef70a14b15838eb593381740

Contents?: true

Size: 370 Bytes

Versions: 8

Compression:

Stored size: 370 Bytes

Contents

module JsonApiClient
  module Query
    class Create < Base
      self.request_method = :post

      def build_params(args)
        @params = {klass.resource_name => args.except(klass.primary_key)}
      end

      # we've nested the parameters, so un-nest them
      def build_path(parameters)
        super(parameters[klass.resource_name])
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
json_api_client-0.9.6 lib/json_api_client/query/create.rb
json_api_client-0.9.5 lib/json_api_client/query/create.rb
json_api_client-0.9.4 lib/json_api_client/query/create.rb
json_api_client-0.9.3 lib/json_api_client/query/create.rb
json_api_client-0.9.2 lib/json_api_client/query/create.rb
json_api_client-0.9.0 lib/json_api_client/query/create.rb
json_api_client-0.8.1 lib/json_api_client/query/create.rb
json_api_client-0.8.0 lib/json_api_client/query/create.rb