Class: Location4meshcode::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/location4meshcode/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(latitude, longitude) ⇒ Point

Returns a new instance of Point.



5
6
7
8
9
# File 'lib/location4meshcode/point.rb', line 5

def initialize(latitude, longitude)
  # 1度 = 60分なので緯度はここで単位を分に変換しておく
  @latitude = (latitude.to_f) * 60
  @longitude = longitude.to_f
end

Instance Attribute Details

#latitudeObject (readonly)

Returns the value of attribute latitude.



3
4
5
# File 'lib/location4meshcode/point.rb', line 3

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



3
4
5
# File 'lib/location4meshcode/point.rb', line 3

def longitude
  @longitude
end

Instance Method Details

#meshcode(level:) ⇒ Object



11
12
13
14
# File 'lib/location4meshcode/point.rb', line 11

def meshcode(level:)
  call_method = "meshcode_level#{level}"
  send(call_method.to_sym)
end