Class: INat::Data::Types::Radius

Inherits:
Object
  • Object
show all
Defined in:
lib/inat/data/types/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(latitude, longitude, radius) ⇒ Radius

Returns a new instance of Radius.

Raises:

  • (ArgumentError)


63
64
65
66
67
68
# File 'lib/inat/data/types/location.rb', line 63

def initialize latitude, longitude, radius
  raise ArgumentError, "Latitude must be a Numeric!", caller  unless Numeric === latitude
  raise ArgumentError, "Longitude must be a Numeric!", caller unless Numeric === longitude
  raise ArgumentError, "Radius must be a Numeric!", caller    unless Numeric === radius    || radius == nil
  @latitude, @longitude, @radius = latitude, longitude, radius
end

Instance Attribute Details

#latitudeObject (readonly)

Returns the value of attribute latitude.



61
62
63
# File 'lib/inat/data/types/location.rb', line 61

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



61
62
63
# File 'lib/inat/data/types/location.rb', line 61

def longitude
  @longitude
end

#radiusObject (readonly)

Returns the value of attribute radius.



61
62
63
# File 'lib/inat/data/types/location.rb', line 61

def radius
  @radius
end