Class: CEML::Circle

Inherits:
Struct
  • Object
show all
Defined in:
lib/ceml/models/cast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#latObject

Returns the value of attribute lat

Returns:

  • (Object)

    the current value of lat



96
97
98
# File 'lib/ceml/models/cast.rb', line 96

def lat
  @lat
end

#lngObject

Returns the value of attribute lng

Returns:

  • (Object)

    the current value of lng



96
97
98
# File 'lib/ceml/models/cast.rb', line 96

def lng
  @lng
end

#radiusObject

Returns the value of attribute radius

Returns:

  • (Object)

    the current value of radius



96
97
98
# File 'lib/ceml/models/cast.rb', line 96

def radius
  @radius
end

Instance Method Details

#centerObject



97
# File 'lib/ceml/models/cast.rb', line 97

def center; Geokit::LatLng(lat, lng); end

#contains?(*ll) ⇒ Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/ceml/models/cast.rb', line 98

def contains?(*ll)
  center.distance_to(Geokit::LatLng(*ll), :meters) <= radius
end