Class: Queries::ExistsQueryBuilder
- Inherits:
-
QueryBuilder
- Object
- QueryBuilder
- Queries::ExistsQueryBuilder
- Defined in:
- lib/queries/exists_query_builder.rb
Constant Summary collapse
- NAME =
"exists"
Instance Attribute Summary collapse
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
Instance Method Summary collapse
-
#field_name_expr ⇒ Object
returns field_name.
-
#initialize(field_name:) ⇒ ExistsQueryBuilder
constructor
@params: field_name: name of the field the existence of whose value is checked.
- #query ⇒ Object
Methods inherited from QueryBuilder
Methods included from AttributesReader
Methods included from AbstractQueryBuilder
Constructor Details
#initialize(field_name:) ⇒ ExistsQueryBuilder
@params:
field_name: name of the field the existence of whose value is checked
14 15 16 |
# File 'lib/queries/exists_query_builder.rb', line 14 def initialize field_name: @field_name= field_name end |
Instance Attribute Details
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
8 9 10 |
# File 'lib/queries/exists_query_builder.rb', line 8 def field_name @field_name end |
Instance Method Details
#field_name_expr ⇒ Object
returns field_name
27 28 29 |
# File 'lib/queries/exists_query_builder.rb', line 27 def field_name_expr return @field_name end |
#query ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/queries/exists_query_builder.rb', line 18 def query query = {} exists_query = self.common_query exists_query[:field] = @field_name query[name.intern] = exists_query return query end |