Class: Moneybird::Webhook
- Inherits:
-
Object
- Object
- Moneybird::Webhook
- Extended by:
- Resource::ClassMethods
- Includes:
- Resource
- Defined in:
- lib/moneybird/webhook.rb
Instance Attribute Summary
Attributes included from Resource::ClassMethods
#attributes, #logger, #nillable_attributes
Attributes included from Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Resource::ClassMethods
build, has_attributes, has_boolean_attributes, has_datetime_attributes, has_integer_attributes, has_nillable_attributes, resource
Methods included from Resource
#attributes, #attributes=, #initialize, #path, #persisted?, #to_json
Class Method Details
.from_json(payload) ⇒ Object
24 25 26 |
# File 'lib/moneybird/webhook.rb', line 24 def self.from_json(payload) build(JSON.parse(payload)) end |
Instance Method Details
#build_entity ⇒ Object
16 17 18 |
# File 'lib/moneybird/webhook.rb', line 16 def build_entity entity_resource_class.new(entity) end |
#entity_resource_class ⇒ Object
20 21 22 |
# File 'lib/moneybird/webhook.rb', line 20 def entity_resource_class Object.const_get "Moneybird::Resource::#{entity_type}" end |