Module: Mongoid::Extensions::Symbol::Inflections
- Defined in:
- lib/mongoid_spacial/extentions/symbol/inflections.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#near(calc = :flat) ⇒ Criterion::NearSpacial
return a class that will accept a value to convert the query correctly for near.
-
#near_sphere ⇒ Criterion::NearSpacial
alias for self.near(:sphere).
- #within(shape) ⇒ Criterion::WithinSpacial
Instance Method Details
#near(calc = :flat) ⇒ Criterion::NearSpacial
return a class that will accept a value to convert the query correctly for near
13 14 15 |
# File 'lib/mongoid_spacial/extentions/symbol/inflections.rb', line 13 def near(calc = :flat) Criterion::NearSpacial.new(:operator => get_op('near',calc), :key => self) end |
#near_sphere ⇒ Criterion::NearSpacial
alias for self.near(:sphere)
20 21 22 |
# File 'lib/mongoid_spacial/extentions/symbol/inflections.rb', line 20 def near_sphere self.near(:sphere) end |
#within(shape) ⇒ Criterion::WithinSpacial
27 28 29 30 |
# File 'lib/mongoid_spacial/extentions/symbol/inflections.rb', line 27 def within(shape) shape = get_op(:center,:sphere) if shape == :center_sphere Criterion::WithinSpacial.new(:operator => shape.to_s , :key => self) end |