Class: ROM::HTTP::Dataset::ResponseTransformers::Schemad
- Inherits:
-
Object
- Object
- ROM::HTTP::Dataset::ResponseTransformers::Schemad
- Defined in:
- lib/rom/http/dataset/response_transformers/schemad.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #call(response, dataset) ⇒ Object
-
#initialize(schema) ⇒ Schemad
constructor
A new instance of Schemad.
Constructor Details
#initialize(schema) ⇒ Schemad
Returns a new instance of Schemad.
10 11 12 |
# File 'lib/rom/http/dataset/response_transformers/schemad.rb', line 10 def initialize(schema) @schema = schema end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
8 9 10 |
# File 'lib/rom/http/dataset/response_transformers/schemad.rb', line 8 def schema @schema end |
Instance Method Details
#call(response, dataset) ⇒ Object
14 15 16 17 18 |
# File 'lib/rom/http/dataset/response_transformers/schemad.rb', line 14 def call(response, dataset) t(:map_array, t(:accept_keys, projections(dataset.projections)) >> ->(tuple) { schema.apply(tuple) } ).call(response) end |