Module: Dynomite::Item::Query::Relation::Ids
- Included in:
- Dynomite::Item::Query::Relation
- Defined in:
- lib/dynomite/item/query/relation/ids.rb
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Surprisingly, Enumberable does not provide empty?.
- #exists?(args = {}) ⇒ Boolean
- #ids ⇒ Object
- #pluck(*names) ⇒ Object
Instance Method Details
#empty? ⇒ Boolean
Surprisingly, Enumberable does not provide empty?
17 18 19 |
# File 'lib/dynomite/item/query/relation/ids.rb', line 17 def empty? !exists? end |
#exists?(args = {}) ⇒ Boolean
12 13 14 |
# File 'lib/dynomite/item/query/relation/ids.rb', line 12 def exists?(args={}) !!limit(1).first end |
#ids ⇒ Object
8 9 10 |
# File 'lib/dynomite/item/query/relation/ids.rb', line 8 def ids project(:id).each.map(&:id).to_a end |
#pluck(*names) ⇒ Object
3 4 5 6 |
# File 'lib/dynomite/item/query/relation/ids.rb', line 3 def pluck(*names) project(*names) super # provided by Ruby Enumerable end |