Module: CassandraObject::Scope::FinderMethods
- Included in:
- CassandraObject::Scope
- Defined in:
- lib/cassandra_object/scope/finder_methods.rb
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
18 19 20 |
# File 'lib/cassandra_object/scope/finder_methods.rb', line 18 def all to_a end |
#find(ids) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/cassandra_object/scope/finder_methods.rb', line 4 def find(ids) if ids.is_a?(Array) find_some(ids) else find_one(ids) end end |
#find_by_id(ids) ⇒ Object
12 13 14 15 16 |
# File 'lib/cassandra_object/scope/finder_methods.rb', line 12 def find_by_id(ids) find(ids) rescue CassandraObject::RecordNotFound nil end |
#first ⇒ Object
22 23 24 |
# File 'lib/cassandra_object/scope/finder_methods.rb', line 22 def first limit(1).to_a.first end |