Class: Mailkube::Pagination
- Inherits:
-
Object
- Object
- Mailkube::Pagination
- Defined in:
- lib/mailkube/types/scheduled_emails.rb,
sig/mailkube/types/scheduled_emails.rbs
Overview
The pagination block that accompanies every listing.
Every member has a default because the server adds total_count and current_page
conditionally, exactly as it does the step links.
Instance Attribute Summary collapse
-
#current_page ⇒ Integer
readonly
Returns the value of attribute current_page.
-
#steps ⇒ PageSteps
readonly
Returns the value of attribute steps.
-
#total_count ⇒ Integer
readonly
Returns the value of attribute total_count.
Class Method Summary collapse
-
.from(payload) ⇒ Pagination
The model.
Instance Method Summary collapse
-
#initialize(steps: PageSteps.new, total_count: 0, current_page: 1) ⇒ Pagination
constructor
A new instance of Pagination.
Constructor Details
#initialize(steps: PageSteps.new, total_count: 0, current_page: 1) ⇒ Pagination
Returns a new instance of Pagination.
66 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 66 def initialize(steps: PageSteps.new, total_count: 0, current_page: 1) = super |
Instance Attribute Details
#current_page ⇒ Integer (readonly)
Returns the value of attribute current_page.
39 40 41 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 39 def current_page @current_page end |
#steps ⇒ PageSteps (readonly)
Returns the value of attribute steps.
37 38 39 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 37 def steps @steps end |
#total_count ⇒ Integer (readonly)
Returns the value of attribute total_count.
38 39 40 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 38 def total_count @total_count end |
Class Method Details
.from(payload) ⇒ Pagination
Returns the model.
70 71 72 73 74 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 70 def self.from(payload) block = payload || {} new(steps: PageSteps.from(block["steps"]), total_count: block["total_count"] || 0, current_page: block["current_page"] || 1) end |