Class: Noiseless::AST::Join
Overview
Join node for cross-collection queries (Typesense feature) Allows including related documents from other collections
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#include_fields ⇒ Object
readonly
Returns the value of attribute include_fields.
-
#on ⇒ Object
readonly
Returns the value of attribute on.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(collection, on:, include_fields: [], strategy: :left) ⇒ Join
constructor
A new instance of Join.
- #inner_join? ⇒ Boolean
- #left_join? ⇒ Boolean
Methods inherited from Node
Constructor Details
#initialize(collection, on:, include_fields: [], strategy: :left) ⇒ Join
Returns a new instance of Join.
14 15 16 17 18 19 20 |
# File 'lib/noiseless/ast/join.rb', line 14 def initialize(collection, on:, include_fields: [], strategy: :left) super() @collection = collection.to_s @on = on @include_fields = Array(include_fields).map(&:to_s) @strategy = strategy end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
8 9 10 |
# File 'lib/noiseless/ast/join.rb', line 8 def collection @collection end |
#include_fields ⇒ Object (readonly)
Returns the value of attribute include_fields.
8 9 10 |
# File 'lib/noiseless/ast/join.rb', line 8 def include_fields @include_fields end |
#on ⇒ Object (readonly)
Returns the value of attribute on.
8 9 10 |
# File 'lib/noiseless/ast/join.rb', line 8 def on @on end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
8 9 10 |
# File 'lib/noiseless/ast/join.rb', line 8 def strategy @strategy end |
Instance Method Details
#inner_join? ⇒ Boolean
26 27 28 |
# File 'lib/noiseless/ast/join.rb', line 26 def inner_join? @strategy == :inner end |
#left_join? ⇒ Boolean
22 23 24 |
# File 'lib/noiseless/ast/join.rb', line 22 def left_join? @strategy == :left end |