Class: EsQueryBuilder::Token
- Inherits:
-
Object
- Object
- EsQueryBuilder::Token
- Defined in:
- lib/es-query-builder/token.rb
Constant Summary collapse
- TYPE_KINDS =
%i(query filter or).freeze
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#field_namespace ⇒ Object
readonly
Returns the value of attribute field_namespace.
-
#full ⇒ Object
readonly
Returns the value of attribute full.
-
#term ⇒ Object
readonly
Returns the value of attribute term.
Instance Method Summary collapse
-
#initialize(full: nil, minus: nil, field: nil, term: nil, type: nil) ⇒ Token
constructor
A new instance of Token.
- #minus? ⇒ Boolean
Constructor Details
#initialize(full: nil, minus: nil, field: nil, term: nil, type: nil) ⇒ Token
Returns a new instance of Token.
7 8 9 10 11 12 13 14 |
# File 'lib/es-query-builder/token.rb', line 7 def initialize(full: nil, minus: nil, field: nil, term: nil, type: nil) @full = full @minus = !!minus @field = field @term = term @type = type @field_namespace = field.to_s[/^(.+?)\./, 1] end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
3 4 5 |
# File 'lib/es-query-builder/token.rb', line 3 def field @field end |
#field_namespace ⇒ Object (readonly)
Returns the value of attribute field_namespace.
3 4 5 |
# File 'lib/es-query-builder/token.rb', line 3 def field_namespace @field_namespace end |
#full ⇒ Object (readonly)
Returns the value of attribute full.
3 4 5 |
# File 'lib/es-query-builder/token.rb', line 3 def full @full end |
#term ⇒ Object (readonly)
Returns the value of attribute term.
3 4 5 |
# File 'lib/es-query-builder/token.rb', line 3 def term @term end |
Instance Method Details
#minus? ⇒ Boolean
16 17 18 |
# File 'lib/es-query-builder/token.rb', line 16 def minus? @minus end |