module Webhooker::Model::ClassMethods

Attributes

webhook_attributes[RW]
webhook_attributes_method[RW]

Public Instance Methods

webhooks(*args) click to toggle source
# File lib/webhooker/model.rb, line 42
def webhooks *args
  options = args.extract_options!
  (options[:on] || %i(create update destroy)).each do |action|
    send :"after_#{action}", :"_trigger_webhook_on_#{action}"
  end
  @webhook_attributes = options[:attributes].try(:map, &:to_s)
  @webhook_attributes_method = options[:attributes_method] || Webhooker.config.attributes_method
end