Class: DatastaxRails::GroupedCollection
- Defined in:
- lib/datastax_rails/grouped_collection.rb
Overview
GroupedCollection extends Hash to add some additional metadata. The hash keys will be the values for the thing that was grouped on. The hash entries point to instances of DatastaxRails::Collection.
Instance Attribute Summary collapse
-
#total_entries ⇒ Fixnum
The total number of entries *in the largest group*.
-
#total_for_all ⇒ Fixnum
The total number of entries across all groups that match this search.
-
#total_groups ⇒ Fixnum
The total number of groups if the groups were paginated (not supported yet).
Instance Method Summary collapse
Instance Attribute Details
#total_entries ⇒ Fixnum
Returns the total number of entries *in the largest group*. This is to allow will_paginate to work.
11 12 13 |
# File 'lib/datastax_rails/grouped_collection.rb', line 11 def total_entries @total_entries end |
#total_for_all ⇒ Fixnum
Returns the total number of entries across all groups that match this search.
11 |
# File 'lib/datastax_rails/grouped_collection.rb', line 11 attr_accessor :total_entries, :total_groups, :total_for_all |
#total_groups ⇒ Fixnum
Returns the total number of groups if the groups were paginated (not supported yet).
11 |
# File 'lib/datastax_rails/grouped_collection.rb', line 11 attr_accessor :total_entries, :total_groups, :total_for_all |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/datastax_rails/grouped_collection.rb', line 13 def inspect "<DatastaxRails::GroupedCollection##{object_id} contents: #{super} matching_records #{total_for_all}>" end |