Module: Alchemrest::Data::Schema::ClassMethods
- Defined in:
- lib/alchemrest/data/schema.rb
Instance Method Summary collapse
- #[] ⇒ Object
- #capture_configuration ⇒ Object
- #configure_response_capture ⇒ Object
- #from_hash(hash) ⇒ Object
- #graph ⇒ Object
- #response_transformer ⇒ Object
Instance Method Details
#[] ⇒ Object
66 67 68 |
# File 'lib/alchemrest/data/schema.rb', line 66 def [] self::Collection end |
#capture_configuration ⇒ Object
49 50 51 |
# File 'lib/alchemrest/data/schema.rb', line 49 def capture_configuration @capture_configuration ||= CaptureConfiguration.new(host_class: self) end |
#configure_response_capture ⇒ Object
74 75 76 |
# File 'lib/alchemrest/data/schema.rb', line 74 def configure_response_capture(&) @capture_configuration = CaptureConfiguration.new(host_class: self, &) end |
#from_hash(hash) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/alchemrest/data/schema.rb', line 57 def from_hash(hash) transform_prelude = self::TRANSFORM.call(hash.deep_stringify_keys) if transform_prelude.right? transform_prelude.from_right else raise MorpherTransformError, transform_prelude.from_left end end |
#graph ⇒ Object
70 71 72 |
# File 'lib/alchemrest/data/schema.rb', line 70 def graph self::GRAPH end |
#response_transformer ⇒ Object
53 54 55 |
# File 'lib/alchemrest/data/schema.rb', line 53 def response_transformer Alchemrest::ResponseTransformers::Morpher.new(self::TRANSFORM) end |