Class: LedgerSync::Domains::Operation::Search::PaginatedResult
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- LedgerSync::Domains::Operation::Search::PaginatedResult
- Defined in:
- lib/ledger_sync/domains/operation/search.rb
Overview
make kaminari work with serialized results
Instance Attribute Summary collapse
-
#current_page ⇒ Object
Returns the value of attribute current_page.
-
#last_page ⇒ Object
Returns the value of attribute last_page.
-
#limit_value ⇒ Object
Returns the value of attribute limit_value.
-
#next_page ⇒ Object
Returns the value of attribute next_page.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#current_page ⇒ Object
Returns the value of attribute current_page.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def current_page @current_page end |
#last_page ⇒ Object
Returns the value of attribute last_page.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def last_page @last_page end |
#limit_value ⇒ Object
Returns the value of attribute limit_value.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def limit_value @limit_value end |
#next_page ⇒ Object
Returns the value of attribute next_page.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def next_page @next_page end |
#total_count ⇒ Object
Returns the value of attribute total_count.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def total_count @total_count end |
#total_pages ⇒ Object
Returns the value of attribute total_pages.
12 13 14 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 12 def total_pages @total_pages end |
Class Method Details
.from_result(result, items:) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 15 def self.from_result(result, items:) search = new(items) search.next_page = result.next_page search.last_page = result.last_page? search.current_page = result.current_page search.total_pages = result.total_pages search.total_count = result.total_count search.limit_value = result.limit_value search end |
Instance Method Details
#last_page? ⇒ Boolean
26 27 28 |
# File 'lib/ledger_sync/domains/operation/search.rb', line 26 def last_page? last_page == true end |