Class: Nexus::Invision::Resources::Page
- Inherits:
-
Object
- Object
- Nexus::Invision::Resources::Page
- Extended by:
- T::Generic, T::Sig
- Includes:
- ValueObject
- Defined in:
- lib/nexus/invision/resources/page.rb
Constant Summary collapse
- TResource =
type_member { { upper: T::Struct } }
Instance Method Summary collapse
-
#initialize(page:, per_page:, total_results:, total_pages:, results:) ⇒ Page
constructor
A new instance of Page.
- #serialize ⇒ Object
Methods included from ValueObject
Constructor Details
#initialize(page:, per_page:, total_results:, total_pages:, results:) ⇒ Page
Returns a new instance of Page.
27 28 29 30 31 32 33 |
# File 'lib/nexus/invision/resources/page.rb', line 27 def initialize(page:, per_page:, total_results:, total_pages:, results:) @page = page @per_page = per_page @total_results = total_results @total_pages = total_pages @results = results end |
Instance Method Details
#serialize ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/nexus/invision/resources/page.rb', line 36 def serialize { "page" => @page, "perPage" => @per_page, "totalResults" => @total_results, "totalPages" => @total_pages, "results" => @results.map(&:serialize), } end |