Module: Webhooker::Model::ClassMethods
- Defined in:
- lib/webhooker/model.rb
Instance Attribute Summary collapse
-
#webhook_attributes ⇒ Object
Returns the value of attribute webhook_attributes.
-
#webhook_attributes_method ⇒ Object
Returns the value of attribute webhook_attributes_method.
Instance Method Summary collapse
Instance Attribute Details
#webhook_attributes ⇒ Object
Returns the value of attribute webhook_attributes.
40 41 42 |
# File 'lib/webhooker/model.rb', line 40 def webhook_attributes @webhook_attributes end |
#webhook_attributes_method ⇒ Object
Returns the value of attribute webhook_attributes_method.
40 41 42 |
# File 'lib/webhooker/model.rb', line 40 def webhook_attributes_method @webhook_attributes_method end |
Instance Method Details
#webhooks(*args) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/webhooker/model.rb', line 42 def webhooks *args = args. ([:on] || %i(create update destroy)).each do |action| send :"after_#{action}", :"_trigger_webhook_on_#{action}" end @webhook_attributes = [:attributes].try(:map, &:to_s) @webhook_attributes_method = [:attributes_method] || Webhooker.config.attributes_method end |