Module: Desertcart::Operation::Mixin::InstanceMethods
- Defined in:
- lib/desertcart/operation.rb
Instance Method Summary collapse
- #deserialized_resource ⇒ Object
- #ledger_namespace_path ⇒ Object
- #ledger_resource_path ⇒ Object
- #ledger_resource_type ⇒ Object
Instance Method Details
#deserialized_resource ⇒ Object
24 25 26 27 28 29 |
# File 'lib/desertcart/operation.rb', line 24 def deserialized_resource deserializer.deserialize( hash: response.body[ledger_resource_type], resource: resource ) end |
#ledger_namespace_path ⇒ Object
20 21 22 |
# File 'lib/desertcart/operation.rb', line 20 def ledger_namespace_path @ledger_namespace_path ||= nil end |
#ledger_resource_path ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/desertcart/operation.rb', line 12 def ledger_resource_path @ledger_resource_path ||= [ ledger_namespace_path, ledger_resource_type.pluralize, resource.ledger_id ].compact.join('/') end |
#ledger_resource_type ⇒ Object
31 32 33 34 35 |
# File 'lib/desertcart/operation.rb', line 31 def ledger_resource_type @ledger_resource_type ||= client.class.ledger_resource_type_for( resource_class: resource.class ) end |