Class: Couchbase::SearchQuery::BooleanFieldQuery

Inherits:
SearchQuery
  • Object
show all
Defined in:
lib/couchbase/search_options.rb

Overview

Allow to match true/false in a field mapped as boolean.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) {|self| ... } ⇒ BooleanFieldQuery

Returns a new instance of BooleanFieldQuery.

Parameters:

  • value (Boolean)

Yield Parameters:



339
340
341
342
343
# File 'lib/couchbase/search_options.rb', line 339

def initialize(value)
  super()
  @value = value
  yield self if block_given?
end

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


331
332
333
# File 'lib/couchbase/search_options.rb', line 331

def boost
  @boost
end

#fieldString

Returns:

  • (String)


334
335
336
# File 'lib/couchbase/search_options.rb', line 334

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



346
347
348
349
350
351
# File 'lib/couchbase/search_options.rb', line 346

def to_h
  data = {:bool => @value}
  data[:boost] = boost if boost
  data[:field] = field if field
  data
end