Class: QDA::Query::WordSearchFunction

Inherits:
Function
  • Object
show all
Defined in:
lib/weft/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Function

#calculated?, #to_a

Constructor Details

#initialize(app, word, options = {}) ⇒ WordSearchFunction

Returns a new instance of WordSearchFunction.



111
112
113
114
115
116
117
118
# File 'lib/weft/query.rb', line 111

def initialize(app, word, options = {})
  super(app)
  if word.empty?
    raise ArgumentError.new('No word supplied for CONTAINS WORD function')
  end
  @word = word
  @options = options
end

Instance Attribute Details

#wordObject (readonly)

Returns the value of attribute word.



110
111
112
# File 'lib/weft/query.rb', line 110

def word
  @word
end

Instance Method Details

#calculateObject



124
125
126
# File 'lib/weft/query.rb', line 124

def calculate()
  @app.get_search_fragments(@word, @options)
end

#to_sObject



120
121
122
# File 'lib/weft/query.rb', line 120

def to_s()
  "( SEARCH(#{@word.inspect}) )"
end