Class: Margrid::Paginator
- Inherits:
-
Struct
- Object
- Struct
- Margrid::Paginator
- Defined in:
- lib/margrid/components.rb
Instance Attribute Summary collapse
-
#current_page ⇒ Object
Returns the value of attribute current_page.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#current_page ⇒ Object
Returns the value of attribute current_page
40 41 42 |
# File 'lib/margrid/components.rb', line 40 def current_page @current_page end |
Class Method Details
.load(data) ⇒ Object
45 46 47 |
# File 'lib/margrid/components.rb', line 45 def self.load(data) new data["page"] if data.key? "page" end |
Instance Method Details
#apply(relation) ⇒ Object
41 42 43 |
# File 'lib/margrid/components.rb', line 41 def apply(relation) relation.page current_page end |
#dump ⇒ Object
49 50 51 |
# File 'lib/margrid/components.rb', line 49 def dump {"page" => current_page} end |