Class: GeoDistance::Distance::Unit
- Inherits:
-
Object
- Object
- GeoDistance::Distance::Unit
- Defined in:
- lib/geo-distance.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(name, number = 0) ⇒ Unit
constructor
A new instance of Unit.
- #to_s ⇒ Object
Constructor Details
#initialize(name, number = 0) ⇒ Unit
Returns a new instance of Unit.
103 104 105 106 |
# File 'lib/geo-distance.rb', line 103 def initialize name, number = 0 @name = name @number = number end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
101 102 103 |
# File 'lib/geo-distance.rb', line 101 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
101 102 103 |
# File 'lib/geo-distance.rb', line 101 def number @number end |
Instance Method Details
#to_s ⇒ Object
112 113 114 |
# File 'lib/geo-distance.rb', line 112 def to_s "#{number} #{name}" end |