Class: DatastaxRails::Collection
- Defined in:
- lib/datastax_rails/collection.rb
Instance Attribute Summary collapse
-
#current_page ⇒ Fixnum
The current page of the search that produced these results (used by will_paginate).
-
#facets ⇒ Hash
The facet results (field and/or range).
-
#highlights ⇒ Object
Returns the value of attribute highlights.
-
#per_page ⇒ Fixnum
The per page value of the search that produced these results (used by will_paginate).
-
#total_entries ⇒ Fixnum
The total number of entries that match the search.
Instance Method Summary collapse
Instance Attribute Details
#current_page ⇒ Fixnum
Returns the current page of the search that produced these results (used by will_paginate).
11 |
# File 'lib/datastax_rails/collection.rb', line 11 attr_accessor :total_entries, :per_page, :current_page, :facets, :highlights |
#facets ⇒ Hash
Returns the facet results (field and/or range).
11 |
# File 'lib/datastax_rails/collection.rb', line 11 attr_accessor :total_entries, :per_page, :current_page, :facets, :highlights |
#highlights ⇒ Object
Returns the value of attribute highlights.
11 12 13 |
# File 'lib/datastax_rails/collection.rb', line 11 def highlights @highlights end |
#per_page ⇒ Fixnum
Returns the per page value of the search that produced these results (used by will_paginate).
11 |
# File 'lib/datastax_rails/collection.rb', line 11 attr_accessor :total_entries, :per_page, :current_page, :facets, :highlights |
#total_entries ⇒ Fixnum
Returns the total number of entries that match the search.
11 12 13 |
# File 'lib/datastax_rails/collection.rb', line 11 def total_entries @total_entries end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/datastax_rails/collection.rb', line 13 def inspect "<DatastaxRails::Collection##{object_id} contents: #{super} last_column_name: #{last_column_name.inspect}>" end |
#total_pages ⇒ Object
17 18 19 20 |
# File 'lib/datastax_rails/collection.rb', line 17 def total_pages return 1 unless per_page (total_entries / per_page.to_f).ceil end |