Class: AgnosticBackend::Queryable::Query

Inherits:
TreeNode
  • Object
show all
Defined in:
lib/agnostic_backend/queryable/query.rb

Direct Known Subclasses

Cloudsearch::Query

Instance Attribute Summary collapse

Attributes inherited from TreeNode

#children

Instance Method Summary collapse

Methods inherited from TreeNode

#==, #accept

Methods included from Utilities

included

Constructor Details

#initialize(context) ⇒ Query

Returns a new instance of Query.



7
8
9
10
11
# File 'lib/agnostic_backend/queryable/query.rb', line 7

def initialize(context)
  super()
  @errors ||= Hash.new { |hash, key| hash[key] = Array.new }
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



5
6
7
# File 'lib/agnostic_backend/queryable/query.rb', line 5

def context
  @context
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/agnostic_backend/queryable/query.rb', line 4

def errors
  @errors
end

Instance Method Details

#executeObject

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/agnostic_backend/queryable/query.rb', line 13

def execute
  raise NotImplementedError
end

#set_scroll_cursor(value) ⇒ Object



21
22
23
24
# File 'lib/agnostic_backend/queryable/query.rb', line 21

def set_scroll_cursor(value)
  context.scroll_cursor(value)
  context.build
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/agnostic_backend/queryable/query.rb', line 17

def valid?
  self.accept(AgnosticBackend::Queryable::Validator.new)
end