Class: NoSE::SupportQuery

Inherits:
Query show all
Defined in:
lib/nose/statements/query.rb

Overview

A query required to support an update

Instance Attribute Summary collapse

Attributes inherited from Query

#limit, #order, #select

Attributes included from StatementConditions

#conditions

Attributes inherited from Statement

#comment, #eq_fields, #graph, #group, #key_path, #label, #range_field, #text

Instance Method Summary collapse

Methods inherited from Query

#all_fields, #join_order, parse, #read_only?, #unparse

Methods included from StatementConditions

included, #populate_conditions

Methods inherited from Statement

#materialize_view, parse, #read_only?, #requires_delete?, #requires_insert?

Constructor Details

#initialize(entity, params, text, group: nil, label: nil) ⇒ SupportQuery

Returns a new instance of SupportQuery.



138
139
140
141
142
# File 'lib/nose/statements/query.rb', line 138

def initialize(entity, params, text, group: nil, label: nil)
  super params, text, group: group, label: label

  @entity = entity
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



136
137
138
# File 'lib/nose/statements/query.rb', line 136

def entity
  @entity
end

#indexObject (readonly)

Returns the value of attribute index.



136
137
138
# File 'lib/nose/statements/query.rb', line 136

def index
  @index
end

#statementObject (readonly)

Returns the value of attribute statement.



136
137
138
# File 'lib/nose/statements/query.rb', line 136

def statement
  @statement
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

Support queries must also have their statement and index checked



145
146
147
148
# File 'lib/nose/statements/query.rb', line 145

def ==(other)
  other.is_a?(SupportQuery) && @statement == other.statement &&
    @index == other.index && @comment == other.comment
end

#hashObject



151
152
153
# File 'lib/nose/statements/query.rb', line 151

def hash
  @hash ||= Zlib.crc32_combine super, @index.hash, @index.hash_str.length
end

#to_colorObject

:nocov:



156
157
158
# File 'lib/nose/statements/query.rb', line 156

def to_color
  super.to_color + ' for [magenta]' + @index.key + '[/]'
end