Class: Noiseless::AST::ImageQuery
- Defined in:
- lib/noiseless/ast/image_query.rb
Overview
Image search node for Typesense visual search Supports searching by image URL or base64 encoded image data
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#image_data ⇒ Object
readonly
Returns the value of attribute image_data.
-
#k ⇒ Object
readonly
Returns the value of attribute k.
Instance Method Summary collapse
- #base64? ⇒ Boolean
-
#initialize(field, image_data, k: 10) ⇒ ImageQuery
constructor
A new instance of ImageQuery.
- #url? ⇒ Boolean
Methods inherited from Node
Constructor Details
#initialize(field, image_data, k: 10) ⇒ ImageQuery
Returns a new instance of ImageQuery.
13 14 15 16 17 18 |
# File 'lib/noiseless/ast/image_query.rb', line 13 def initialize(field, image_data, k: 10) super() @field = field @image_data = image_data @k = k end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
8 9 10 |
# File 'lib/noiseless/ast/image_query.rb', line 8 def field @field end |
#image_data ⇒ Object (readonly)
Returns the value of attribute image_data.
8 9 10 |
# File 'lib/noiseless/ast/image_query.rb', line 8 def image_data @image_data end |
#k ⇒ Object (readonly)
Returns the value of attribute k.
8 9 10 |
# File 'lib/noiseless/ast/image_query.rb', line 8 def k @k end |
Instance Method Details
#base64? ⇒ Boolean
24 25 26 |
# File 'lib/noiseless/ast/image_query.rb', line 24 def base64? !url? end |
#url? ⇒ Boolean
20 21 22 |
# File 'lib/noiseless/ast/image_query.rb', line 20 def url? @image_data.start_with?("http://", "https://") end |