Class: Appwrite::Query
- Inherits:
-
Object
- Object
- Appwrite::Query
- Defined in:
- lib/appwrite/query.rb
Class Method Summary collapse
- .between(attribute, start, ending) ⇒ Object
- .cursor_after(id) ⇒ Object
- .cursor_before(id) ⇒ Object
- .ends_with(attribute, value) ⇒ Object
- .equal(attribute, value) ⇒ Object
- .greater_than(attribute, value) ⇒ Object
- .greater_than_equal(attribute, value) ⇒ Object
- .is_not_null(attribute) ⇒ Object
- .is_null(attribute) ⇒ Object
- .less_than(attribute, value) ⇒ Object
- .less_than_equal(attribute, value) ⇒ Object
- .limit(limit) ⇒ Object
- .not_equal(attribute, value) ⇒ Object
- .offset(offset) ⇒ Object
- .order_asc(attribute) ⇒ Object
- .order_desc(attribute) ⇒ Object
- .search(attribute, value) ⇒ Object
- .select(attributes) ⇒ Object
- .starts_with(attribute, value) ⇒ Object
Class Method Details
.between(attribute, start, ending) ⇒ Object
36 37 38 |
# File 'lib/appwrite/query.rb', line 36 def between(attribute, start, ending) return add_query(attribute, "between", [start, ending]) end |
.cursor_after(id) ⇒ Object
68 69 70 |
# File 'lib/appwrite/query.rb', line 68 def cursor_after(id) return "cursorAfter(\"#{id}\")" end |
.cursor_before(id) ⇒ Object
64 65 66 |
# File 'lib/appwrite/query.rb', line 64 def cursor_before(id) return "cursorBefore(\"#{id}\")" end |
.ends_with(attribute, value) ⇒ Object
44 45 46 |
# File 'lib/appwrite/query.rb', line 44 def ends_with(attribute, value) return add_query(attribute, "endsWith", value) end |
.equal(attribute, value) ⇒ Object
4 5 6 |
# File 'lib/appwrite/query.rb', line 4 def equal(attribute, value) return add_query(attribute, "equal", value) end |
.greater_than(attribute, value) ⇒ Object
20 21 22 |
# File 'lib/appwrite/query.rb', line 20 def greater_than(attribute, value) return add_query(attribute, "greaterThan", value) end |
.greater_than_equal(attribute, value) ⇒ Object
24 25 26 |
# File 'lib/appwrite/query.rb', line 24 def greater_than_equal(attribute, value) return add_query(attribute, "greaterThanEqual", value) end |
.is_not_null(attribute) ⇒ Object
32 33 34 |
# File 'lib/appwrite/query.rb', line 32 def is_not_null(attribute) return "isNotNull(\"#{attribute}\")" end |
.is_null(attribute) ⇒ Object
28 29 30 |
# File 'lib/appwrite/query.rb', line 28 def is_null(attribute) return "isNull(\"#{attribute}\")" end |
.less_than(attribute, value) ⇒ Object
12 13 14 |
# File 'lib/appwrite/query.rb', line 12 def less_than(attribute, value) return add_query(attribute, "lessThan", value) end |
.less_than_equal(attribute, value) ⇒ Object
16 17 18 |
# File 'lib/appwrite/query.rb', line 16 def less_than_equal(attribute, value) return add_query(attribute, "lessThanEqual", value) end |
.limit(limit) ⇒ Object
72 73 74 |
# File 'lib/appwrite/query.rb', line 72 def limit(limit) return "limit(#{limit})" end |
.not_equal(attribute, value) ⇒ Object
8 9 10 |
# File 'lib/appwrite/query.rb', line 8 def not_equal(attribute, value) return add_query(attribute, "notEqual", value) end |
.offset(offset) ⇒ Object
76 77 78 |
# File 'lib/appwrite/query.rb', line 76 def offset(offset) return "offset(#{offset})" end |
.order_asc(attribute) ⇒ Object
56 57 58 |
# File 'lib/appwrite/query.rb', line 56 def order_asc(attribute) return "orderAsc(\"#{attribute}\")" end |
.order_desc(attribute) ⇒ Object
60 61 62 |
# File 'lib/appwrite/query.rb', line 60 def order_desc(attribute) return "orderDesc(\"#{attribute}\")" end |
.search(attribute, value) ⇒ Object
52 53 54 |
# File 'lib/appwrite/query.rb', line 52 def search(attribute, value) return add_query(attribute, "search", value) end |
.select(attributes) ⇒ Object
48 49 50 |
# File 'lib/appwrite/query.rb', line 48 def select(attributes) return "select([#{attributes.map {|attribute| "\"#{attribute}\""}.join(',')}])" end |
.starts_with(attribute, value) ⇒ Object
40 41 42 |
# File 'lib/appwrite/query.rb', line 40 def starts_with(attribute, value) return add_query(attribute, "startsWith", value) end |