Class: MarbleApiClient::Requests::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/marble_api_client/requests/create.rb

Overview

Request object for sending create requests. Uses context and record to send data that the service model can use in controllers

Instance Method Summary collapse

Constructor Details

#initialize(context: {}, record: {}) ⇒ Create

Returns a new instance of Create.



18
19
20
21
22
# File 'lib/marble_api_client/requests/create.rb', line 18

def initialize(context: {}, record: {})
  @context = context
  @record = record
  freeze
end

Instance Method Details

#request_bodyObject



24
25
26
27
28
29
# File 'lib/marble_api_client/requests/create.rb', line 24

def request_body
  {
    context: @context,
    record: @record
  }.to_json
end