Class: ActionSlack::Webhook

Inherits:
Object
  • Object
show all
Defined in:
lib/action_slack/webhook.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(webhook) ⇒ Webhook

Returns a new instance of Webhook.



36
37
38
39
# File 'lib/action_slack/webhook.rb', line 36

def initialize(webhook)
  @name = webhook[:name]
  @url = webhook[:url]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/action_slack/webhook.rb', line 5

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/action_slack/webhook.rb', line 5

def url
  @url
end

Class Method Details

.find(name) ⇒ Object



12
13
14
# File 'lib/action_slack/webhook.rb', line 12

def find(name)
  webhooks.find { |webhook| webhook.name == name }
end

.webhooksObject



8
9
10
# File 'lib/action_slack/webhook.rb', line 8

def webhooks
  @webhooks ||= load_webhooks
end