Class: Mara::Persistence::CreateRequest
- Inherits:
-
Struct
- Object
- Struct
- Mara::Persistence::CreateRequest
- Defined in:
- lib/mara/persistence.rb
Overview
A wrapper for a create request.
Instance Attribute Summary collapse
-
#record ⇒ Hash
The record hash to be created.
Instance Method Summary collapse
-
#as_json ⇒ Hash
Converts the CreateRequest to JSON.
Instance Attribute Details
#record ⇒ Hash
The record hash to be created.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mara/persistence.rb', line 30 CreateRequest = Struct.new(:record) do ## # Converts the CreateRequest to JSON # # @return [Hash] def as_json { put_request: { item: record } } end end |
Instance Method Details
#as_json ⇒ Hash
Converts the CreateRequest to JSON
35 36 37 38 39 40 41 |
# File 'lib/mara/persistence.rb', line 35 def as_json { put_request: { item: record } } end |