Class: TocaroWebhook::Payload
- Inherits:
-
Object
- Object
- TocaroWebhook::Payload
- Defined in:
- lib/tocaro_webhook/payload.rb
Defined Under Namespace
Classes: Attachments
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#color ⇒ Object
Returns the value of attribute color.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #add_attachment(options = {}) ⇒ Object
-
#to_body ⇒ Object
uri encode json object.
- #to_h ⇒ Object
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
5 6 7 |
# File 'lib/tocaro_webhook/payload.rb', line 5 def @attachments end |
#color ⇒ Object
Returns the value of attribute color.
5 6 7 |
# File 'lib/tocaro_webhook/payload.rb', line 5 def color @color end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/tocaro_webhook/payload.rb', line 5 def text @text end |
Instance Method Details
#add_attachment(options = {}) ⇒ Object
24 25 26 |
# File 'lib/tocaro_webhook/payload.rb', line 24 def (={}) .add() end |
#to_body ⇒ Object
uri encode json object
8 9 10 |
# File 'lib/tocaro_webhook/payload.rb', line 8 def to_body "payload=" + URI.encode(to_json_string) end |
#to_h ⇒ Object
12 13 14 |
# File 'lib/tocaro_webhook/payload.rb', line 12 def to_h { text: text, color: color, attachments: .to_a } end |