Module: LinkedRails::Collection::Infinite
- Extended by:
- ActiveSupport::Concern
- Included in:
- InfiniteView
- Defined in:
- app/models/linked_rails/collection/infinite.rb
Instance Method Summary collapse
Instance Method Details
#initialize(orignial = {}) ⇒ Object
12 13 14 15 16 |
# File 'app/models/linked_rails/collection/infinite.rb', line 12 def initialize(orignial = {}) attrs = orignial.with_indifferent_access attrs[:before] = attrs[:before]&.map { |val| val.with_indifferent_access } super(attrs) end |
#next ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/linked_rails/collection/infinite.rb', line 18 def next return if before.blank? || members.blank? current_opts = { collection: collection, filter: filter } next_view = collection.view_with_opts(current_opts.merge(before: next_before_values)) next_view.iri if next_view.count.positive? end |
#prev ⇒ Object
30 |
# File 'app/models/linked_rails/collection/infinite.rb', line 30 def prev; end |
#type ⇒ Object
32 33 34 |
# File 'app/models/linked_rails/collection/infinite.rb', line 32 def type :infinite end |