Class: Flipper::Notifications::Webhooks::Webhook

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/flipper/notifications/webhooks/webhook.rb

Direct Known Subclasses

Slack

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:) ⇒ Webhook

Returns a new instance of Webhook.



16
17
18
# File 'lib/flipper/notifications/webhooks/webhook.rb', line 16

def initialize(url:)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'lib/flipper/notifications/webhooks/webhook.rb', line 20

def url
  @url
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/flipper/notifications/webhooks/webhook.rb', line 30

def ==(other)
  other.is_a?(self.class) && url == other.url
end

#notify(**_kwargs) ⇒ Object



22
23
24
# File 'lib/flipper/notifications/webhooks/webhook.rb', line 22

def notify(**_kwargs)
  raise "Implement #notify in your subclass"
end

#serialized_attributesObject



26
27
28
# File 'lib/flipper/notifications/webhooks/webhook.rb', line 26

def serialized_attributes
  { url: url }
end