Class: Sendly::WhatsAppWindow
- Inherits:
-
Object
- Object
- Sendly::WhatsAppWindow
- Defined in:
- lib/sendly/whatsapp_resource.rb
Overview
Whether a 24-hour customer-service window is open between one of your
WhatsApp senders and a recipient. expires_at is when the window
closes (ISO 8601), nil when no window is open.
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
Instance Method Summary collapse
-
#initialize(data) ⇒ WhatsAppWindow
constructor
A new instance of WhatsAppWindow.
- #open? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ WhatsAppWindow
Returns a new instance of WhatsAppWindow.
210 211 212 213 |
# File 'lib/sendly/whatsapp_resource.rb', line 210 def initialize(data) @open = data["open"] || false @expires_at = data["expiresAt"] || data["expires_at"] end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
208 209 210 |
# File 'lib/sendly/whatsapp_resource.rb', line 208 def expires_at @expires_at end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
208 209 210 |
# File 'lib/sendly/whatsapp_resource.rb', line 208 def open @open end |
Instance Method Details
#open? ⇒ Boolean
215 216 217 |
# File 'lib/sendly/whatsapp_resource.rb', line 215 def open? open end |
#to_h ⇒ Object
219 220 221 |
# File 'lib/sendly/whatsapp_resource.rb', line 219 def to_h { open: open, expires_at: expires_at }.compact end |