Class: Webhook
- Inherits:
-
Object
- Object
- Webhook
- Defined in:
- lib/cwr.rb
Instance Method Summary collapse
- #complete? ⇒ Boolean
- #destroy ⇒ Object
- #hooked? ⇒ Boolean
-
#initialize(cwr, path, complete = false) ⇒ Webhook
constructor
A new instance of Webhook.
- #update ⇒ Object
Constructor Details
#initialize(cwr, path, complete = false) ⇒ Webhook
Returns a new instance of Webhook.
68 69 70 71 72 73 |
# File 'lib/cwr.rb', line 68 def initialize(cwr, path, complete=false) @cwr = cwr @path = path @hooked = true @complete = complete end |
Instance Method Details
#complete? ⇒ Boolean
80 81 82 |
# File 'lib/cwr.rb', line 80 def complete? @complete end |
#destroy ⇒ Object
84 85 86 |
# File 'lib/cwr.rb', line 84 def destroy @hooked = false end |
#hooked? ⇒ Boolean
75 76 77 78 |
# File 'lib/cwr.rb', line 75 def hooked? raise "wtf unhookedwebhook" unless @hooked @hooked end |
#update ⇒ Object
88 89 90 91 |
# File 'lib/cwr.rb', line 88 def update resp = @cwr.update_webhook(@path) @complete = !resp["attempt"] end |