Class: ActionSlack::Webhook
- Inherits:
-
Object
- Object
- ActionSlack::Webhook
- Defined in:
- lib/action_slack/webhook.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(webhook) ⇒ Webhook
constructor
A new instance of Webhook.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/action_slack/webhook.rb', line 5 def name @name end |
#url ⇒ Object (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 |
.webhooks ⇒ Object
8 9 10 |
# File 'lib/action_slack/webhook.rb', line 8 def webhooks @webhooks ||= load_webhooks end |