Class: PgEventstore::Web::Paginator::BaseCollection
- Inherits:
-
Object
- Object
- PgEventstore::Web::Paginator::BaseCollection
- Defined in:
- lib/pg_eventstore/web/paginator/base_collection.rb
Direct Known Subclasses
EventTypesCollection, EventsCollection, StreamContextsCollection, StreamIdsCollection, StreamNamesCollection
Instance Attribute Summary collapse
-
#config_name ⇒ Object
Returns the value of attribute config_name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#order ⇒ Object
Returns the value of attribute order.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#starting_id ⇒ Object
Returns the value of attribute starting_id.
Instance Method Summary collapse
- #collection ⇒ Array
- #count ⇒ Integer
-
#initialize(config_name, starting_id:, per_page:, order:, options: {}) ⇒ BaseCollection
constructor
A new instance of BaseCollection.
- #next_page_starting_id ⇒ String, ...
- #prev_page_starting_id ⇒ String, ...
- #total_count ⇒ Integer
Constructor Details
#initialize(config_name, starting_id:, per_page:, order:, options: {}) ⇒ BaseCollection
Returns a new instance of BaseCollection.
28 29 30 31 32 33 34 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 28 def initialize(config_name, starting_id:, per_page:, order:, options: {}) @config_name = config_name @starting_id = starting_id @per_page = per_page @order = order @options = end |
Instance Attribute Details
#config_name ⇒ Object
Returns the value of attribute config_name.
9 10 11 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 9 def config_name @config_name end |
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 21 def @options end |
#order ⇒ Object
Returns the value of attribute order.
18 19 20 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 18 def order @order end |
#per_page ⇒ Object
Returns the value of attribute per_page.
15 16 17 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 15 def per_page @per_page end |
#starting_id ⇒ Object
Returns the value of attribute starting_id.
12 13 14 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 12 def starting_id @starting_id end |
Instance Method Details
#collection ⇒ Array
37 38 39 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 37 def collection raise NotImplementedError end |
#count ⇒ Integer
42 43 44 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 42 def count collection.size end |
#next_page_starting_id ⇒ String, ...
47 48 49 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 47 def next_page_starting_id raise NotImplementedError end |
#prev_page_starting_id ⇒ String, ...
52 53 54 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 52 def prev_page_starting_id raise NotImplementedError end |
#total_count ⇒ Integer
57 58 59 |
# File 'lib/pg_eventstore/web/paginator/base_collection.rb', line 57 def total_count raise NotImplementedError end |