Class: Walinko::SyncResult
- Inherits:
-
Object
- Object
- Walinko::SyncResult
- Defined in:
- lib/walinko/result.rb
Overview
Returned by ‘client.messages.send(…)` (sync mode). Wraps the `data` block of a 200 OK response.
Instance Attribute Summary collapse
-
#device_id ⇒ Object
readonly
Returns the value of attribute device_id.
-
#idempotent_replayed ⇒ Object
readonly
Returns the value of attribute idempotent_replayed.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#rate_limit ⇒ Object
readonly
Returns the value of attribute rate_limit.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#sent_at ⇒ Object
readonly
Returns the value of attribute sent_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#template_id ⇒ Object
readonly
Returns the value of attribute template_id.
-
#tracking_id ⇒ Object
readonly
Returns the value of attribute tracking_id.
-
#variant_index ⇒ Object
readonly
Returns the value of attribute variant_index.
-
#wa_message_id ⇒ Object
readonly
Returns the value of attribute wa_message_id.
Instance Method Summary collapse
-
#initialize(data:, request_id:, rate_limit:, idempotent_replayed:) ⇒ SyncResult
constructor
A new instance of SyncResult.
- #sent? ⇒ Boolean
Constructor Details
#initialize(data:, request_id:, rate_limit:, idempotent_replayed:) ⇒ SyncResult
Returns a new instance of SyncResult.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/walinko/result.rb', line 13 def initialize(data:, request_id:, rate_limit:, idempotent_replayed:) @tracking_id = data['tracking_id'] @status = data['status'] @device_id = data['device_id'] @template_id = data['template_id'] @variant_index = data['variant_index'] @phone = data['phone'] @sent_at = parse_time(data['sent_at']) @wa_message_id = data['wa_message_id'] @request_id = request_id @rate_limit = rate_limit @idempotent_replayed = idempotent_replayed end |
Instance Attribute Details
#device_id ⇒ Object (readonly)
Returns the value of attribute device_id.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def device_id @device_id end |
#idempotent_replayed ⇒ Object (readonly)
Returns the value of attribute idempotent_replayed.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def idempotent_replayed @idempotent_replayed end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def phone @phone end |
#rate_limit ⇒ Object (readonly)
Returns the value of attribute rate_limit.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def rate_limit @rate_limit end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def request_id @request_id end |
#sent_at ⇒ Object (readonly)
Returns the value of attribute sent_at.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def sent_at @sent_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def status @status end |
#template_id ⇒ Object (readonly)
Returns the value of attribute template_id.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def template_id @template_id end |
#tracking_id ⇒ Object (readonly)
Returns the value of attribute tracking_id.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def tracking_id @tracking_id end |
#variant_index ⇒ Object (readonly)
Returns the value of attribute variant_index.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def variant_index @variant_index end |
#wa_message_id ⇒ Object (readonly)
Returns the value of attribute wa_message_id.
9 10 11 |
# File 'lib/walinko/result.rb', line 9 def @wa_message_id end |
Instance Method Details
#sent? ⇒ Boolean
27 28 29 |
# File 'lib/walinko/result.rb', line 27 def sent? status == 'sent' end |