Class: Outpost::Hook
- Inherits:
-
Object
- Object
- Outpost::Hook
- Defined in:
- lib/outpost/hook.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Hook
constructor
A new instance of Hook.
-
#publish ⇒ Object
Publish the message.
Constructor Details
#initialize(options = {}) ⇒ Hook
Returns a new instance of Hook.
9 10 11 12 |
# File 'lib/outpost/hook.rb', line 9 def initialize(={}) @path = [:path] @data = [:data] || { touch: true } end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
7 8 9 |
# File 'lib/outpost/hook.rb', line 7 def data @data end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/outpost/hook.rb', line 7 def path @path end |
Instance Method Details
#publish ⇒ Object
Publish the message
15 16 17 18 19 20 21 22 |
# File 'lib/outpost/hook.rb', line 15 def publish response = connection.post do |request| request.url @path request.params = @data end response end |