Class: UniOne::Webhook
- Inherits:
-
Object
- Object
- UniOne::Webhook
- Defined in:
- lib/unione/helpers/webhook/webhook.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ Webhook
constructor
A new instance of Webhook.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Webhook
Returns a new instance of Webhook.
5 6 7 |
# File 'lib/unione/helpers/webhook/webhook.rb', line 5 def initialize @settings = {} end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
3 4 5 |
# File 'lib/unione/helpers/webhook/webhook.rb', line 3 def events @events end |
#settings ⇒ Object
Returns the value of attribute settings.
3 4 5 |
# File 'lib/unione/helpers/webhook/webhook.rb', line 3 def settings @settings end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/unione/helpers/webhook/webhook.rb', line 3 def url @url end |
Instance Method Details
#to_json ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/unione/helpers/webhook/webhook.rb', line 9 def to_json(*) { url: self.url, events: self.events }.merge(self.settings) .delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {}} end |