Class: Noiseless::AST::MultiMatch
- Inherits:
-
Object
- Object
- Noiseless::AST::MultiMatch
- Defined in:
- lib/noiseless/ast/multi_match.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query, fields, **options) ⇒ MultiMatch
constructor
A new instance of MultiMatch.
- #to_hash ⇒ Object
Constructor Details
#initialize(query, fields, **options) ⇒ MultiMatch
Returns a new instance of MultiMatch.
8 9 10 11 12 |
# File 'lib/noiseless/ast/multi_match.rb', line 8 def initialize(query, fields, **) @query = query @fields = Array(fields) @options = end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/noiseless/ast/multi_match.rb', line 6 def fields @fields end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/noiseless/ast/multi_match.rb', line 6 def @options end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'lib/noiseless/ast/multi_match.rb', line 6 def query @query end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/noiseless/ast/multi_match.rb', line 14 def to_hash { multi_match: { query: @query, fields: @fields }.merge(@options) } end |