Class: JsonApiClient::Query::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/json_api_client/query/create.rb

Instance Attribute Summary

Attributes inherited from Base

#headers, #klass, #params, #path

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect

Constructor Details

This class inherits a constructor from JsonApiClient::Query::Base

Instance Method Details

#build_params(args) ⇒ Object



6
7
8
# File 'lib/json_api_client/query/create.rb', line 6

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

#build_path(parameters) ⇒ Object

we’ve nested the parameters, so un-nest them



11
12
13
# File 'lib/json_api_client/query/create.rb', line 11

def build_path(parameters)
  super(parameters[klass.resource_name])
end