Class: AgnosticBackend::Queryable::Query
- Defined in:
- lib/agnostic_backend/queryable/query.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#executor ⇒ Object
readonly
Returns the value of attribute executor.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from TreeNode
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(context, **options) ⇒ Query
constructor
A new instance of Query.
- #set_scroll_cursor(value) ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from TreeNode
Methods included from Utilities
Constructor Details
#initialize(context, **options) ⇒ Query
Returns a new instance of Query.
9 10 11 12 13 14 |
# File 'lib/agnostic_backend/queryable/query.rb', line 9 def initialize(context, **) super() @errors ||= Hash.new { |hash, key| hash[key] = Array.new } @context = context @options = end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/agnostic_backend/queryable/query.rb', line 5 def context @context end |
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/agnostic_backend/queryable/query.rb', line 4 def errors @errors end |
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
6 7 8 |
# File 'lib/agnostic_backend/queryable/query.rb', line 6 def executor @executor end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/agnostic_backend/queryable/query.rb', line 7 def @options end |
Instance Method Details
#execute ⇒ Object
16 17 18 |
# File 'lib/agnostic_backend/queryable/query.rb', line 16 def execute raise NotImplementedError end |
#set_scroll_cursor(value) ⇒ Object
24 25 26 27 |
# File 'lib/agnostic_backend/queryable/query.rb', line 24 def set_scroll_cursor(value) context.scroll_cursor(value) context.build end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/agnostic_backend/queryable/query.rb', line 20 def valid? self.accept(AgnosticBackend::Queryable::Validator.new) end |