Class: Location4meshcode::Point
- Inherits:
-
Object
- Object
- Location4meshcode::Point
- Defined in:
- lib/location4meshcode/point.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(latitude, longitude) ⇒ Point
constructor
A new instance of Point.
- #meshcode(level:) ⇒ Object
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
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/location4meshcode/point.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object (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 |