Class: ArangoDb::Queries::Query
- Inherits:
-
Object
- Object
- ArangoDb::Queries::Query
- Defined in:
- lib/queries.rb
Instance Method Summary collapse
- #all ⇒ Object
- #attribute(attr_name) ⇒ Object
- #closed(boolean) ⇒ Object
- #first ⇒ Object
-
#initialize(model) ⇒ Query
constructor
A new instance of Query.
- #left(number) ⇒ Object
- #limit(number) ⇒ Object
- #right(number) ⇒ Object
- #skip(number) ⇒ Object
- #where(hash) ⇒ Object
Constructor Details
#initialize(model) ⇒ Query
Returns a new instance of Query.
8 9 10 |
# File 'lib/queries.rb', line 8 def initialize(model) @model = model end |
Instance Method Details
#all ⇒ Object
52 53 54 |
# File 'lib/queries.rb', line 52 def all @model.all(query_parameters) end |
#attribute(attr_name) ⇒ Object
28 29 30 31 |
# File 'lib/queries.rb', line 28 def attribute(attr_name) @attribute = attr_name self end |
#closed(boolean) ⇒ Object
43 44 45 46 |
# File 'lib/queries.rb', line 43 def closed(boolean) @closed = boolean self end |
#first ⇒ Object
48 49 50 |
# File 'lib/queries.rb', line 48 def first @model.first(query_parameters) end |
#left(number) ⇒ Object
33 34 35 36 |
# File 'lib/queries.rb', line 33 def left(number) @left = number self end |
#limit(number) ⇒ Object
18 19 20 21 |
# File 'lib/queries.rb', line 18 def limit(number) @limit = number self end |
#right(number) ⇒ Object
38 39 40 41 |
# File 'lib/queries.rb', line 38 def right(number) @right = number self end |
#skip(number) ⇒ Object
23 24 25 26 |
# File 'lib/queries.rb', line 23 def skip(number) @skip = number self end |
#where(hash) ⇒ Object
12 13 14 15 16 |
# File 'lib/queries.rb', line 12 def where(hash) @where ||= {} @where.merge!(hash) self end |