Class: Webhookr::Service
- Inherits:
-
Object
- Object
- Webhookr::Service
- Defined in:
- lib/webhookr/service.rb
Instance Attribute Summary collapse
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Instance Method Summary collapse
-
#initialize(service_name, options = {}) ⇒ Service
constructor
A new instance of Service.
- #process! ⇒ Object
Constructor Details
#initialize(service_name, options = {}) ⇒ Service
Returns a new instance of Service.
5 6 7 8 9 10 |
# File 'lib/webhookr/service.rb', line 5 def initialize(service_name, = {}) @service_name = (service_name || "").downcase @raw_payload = [:payload] available? validate_security_token([:security_token]) if configured_security_token end |
Instance Attribute Details
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
3 4 5 |
# File 'lib/webhookr/service.rb', line 3 def service_name @service_name end |
Instance Method Details
#process! ⇒ Object
12 13 14 15 16 |
# File 'lib/webhookr/service.rb', line 12 def process! Array.wrap(service_adapter.send(:process, @raw_payload)).each do |payload| callback(callback_class, payload) end end |