Class: Sunspot::Query::Restriction::InRadius

Inherits:
Base
  • Object
show all
Defined in:
lib/sunspot/query/restriction.rb

Constant Summary

Constants inherited from Base

Base::RESERVED_WORDS

Instance Method Summary collapse

Methods inherited from Base

#negated?, #to_boolean_phrase, #to_negated_boolean_phrase, #to_params

Methods included from Filter

#tag, #to_filter_query

Constructor Details

#initialize(negated, field, *value) ⇒ InRadius

Returns a new instance of InRadius.



161
162
163
164
# File 'lib/sunspot/query/restriction.rb', line 161

def initialize(negated, field, *value)
  @lat, @lon, @radius = value
  super negated, field, value
end

Instance Method Details

#negateObject



166
167
168
# File 'lib/sunspot/query/restriction.rb', line 166

def negate
  self.class.new(!@negated, @field, *@value)
end