Class: Tradenity::Page
- Inherits:
-
Array
- Object
- Array
- Tradenity::Page
- Defined in:
- lib/tradenity/resources/paging.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
-
#number_of_elements ⇒ Object
Returns the value of attribute number_of_elements.
-
#size ⇒ Object
Returns the value of attribute size.
-
#total_elements ⇒ Object
Returns the value of attribute total_elements.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
Instance Method Summary collapse
-
#initialize(content = [], total_pages, total_elements, number, size, number_of_elements) ⇒ Page
constructor
A new instance of Page.
- #is_empty? ⇒ Boolean
Constructor Details
#initialize(content = [], total_pages, total_elements, number, size, number_of_elements) ⇒ Page
Returns a new instance of Page.
15 16 17 18 19 20 21 22 |
# File 'lib/tradenity/resources/paging.rb', line 15 def initialize(content=[], total_pages, total_elements, number, size, number_of_elements) concat(content) @total_pages = total_pages @total_elements = total_elements @number = number @size = size @number_of_elements = number_of_elements end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
9 10 11 |
# File 'lib/tradenity/resources/paging.rb', line 9 def number @number end |
#number_of_elements ⇒ Object
Returns the value of attribute number_of_elements.
13 14 15 |
# File 'lib/tradenity/resources/paging.rb', line 13 def number_of_elements @number_of_elements end |
#size ⇒ Object
Returns the value of attribute size.
11 12 13 |
# File 'lib/tradenity/resources/paging.rb', line 11 def size @size end |
#total_elements ⇒ Object
Returns the value of attribute total_elements.
7 8 9 |
# File 'lib/tradenity/resources/paging.rb', line 7 def total_elements @total_elements end |
#total_pages ⇒ Object
Returns the value of attribute total_pages.
5 6 7 |
# File 'lib/tradenity/resources/paging.rb', line 5 def total_pages @total_pages end |
Instance Method Details
#is_empty? ⇒ Boolean
24 25 26 |
# File 'lib/tradenity/resources/paging.rb', line 24 def is_empty? @size <= 0 end |