Class: Mailkube::ScheduledEmailPage
- Inherits:
-
Object
- Object
- Mailkube::ScheduledEmailPage
- Defined in:
- lib/mailkube/types/scheduled_emails.rb,
sig/mailkube/types/scheduled_emails.rbs
Overview
One page of scheduled emails: the records, plus how to reach the neighbouring pages.
Instance Attribute Summary collapse
-
#data ⇒ Array[ScheduledEmail]
readonly
Returns the value of attribute data.
-
#pagination ⇒ Pagination
readonly
Returns the value of attribute pagination.
Class Method Summary collapse
-
.from(payload) ⇒ ScheduledEmailPage
The model.
Instance Method Summary collapse
-
#initialize(pagination: Pagination.new, data: []) ⇒ ScheduledEmailPage
constructor
A new instance of ScheduledEmailPage.
-
#more? ⇒ Boolean
Spelled
more?rather thanhas_more: Ruby's predicate convention, and the same call this gem already makes forEmail#scheduled?where the other SDKs sayis_scheduled.
Constructor Details
#initialize(pagination: Pagination.new, data: []) ⇒ ScheduledEmailPage
Returns a new instance of ScheduledEmailPage.
81 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 81 def initialize(pagination: Pagination.new, data: []) = super |
Instance Attribute Details
#data ⇒ Array[ScheduledEmail] (readonly)
Returns the value of attribute data.
47 48 49 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 47 def data @data end |
#pagination ⇒ Pagination (readonly)
Returns the value of attribute pagination.
46 47 48 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 46 def pagination @pagination end |
Class Method Details
.from(payload) ⇒ ScheduledEmailPage
Returns the model.
85 86 87 88 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 85 def self.from(payload) new(pagination: Pagination.from(payload["pagination"]), data: (payload["data"] || []).map { |item| ScheduledEmail.from(item) }) end |
Instance Method Details
#more? ⇒ Boolean
Spelled more? rather than has_more: Ruby's predicate convention, and the same call this
gem already makes for Email#scheduled? where the other SDKs say is_scheduled.
94 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 94 def more? = !pagination.steps.next.nil? |