Class: Sample
- Inherits:
-
Object
- Object
- Sample
- Defined in:
- lib/sample.rb
Instance Attribute Summary collapse
-
#point ⇒ Object
readonly
Returns the value of attribute point.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time, point) ⇒ Sample
constructor
A new instance of Sample.
- #lat ⇒ Object
- #long ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(time, point) ⇒ Sample
Returns a new instance of Sample.
5 6 7 8 9 10 11 12 |
# File 'lib/sample.rb', line 5 def initialize(time, point) if(time.nil? or point.nil?) raise ArgumentError end @time = time @point = point end |
Instance Attribute Details
#point ⇒ Object (readonly)
Returns the value of attribute point.
3 4 5 |
# File 'lib/sample.rb', line 3 def point @point end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/sample.rb', line 3 def time @time end |
Instance Method Details
#lat ⇒ Object
18 19 20 |
# File 'lib/sample.rb', line 18 def lat point.lat end |
#long ⇒ Object
22 23 24 |
# File 'lib/sample.rb', line 22 def long point.long end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/sample.rb', line 14 def to_s @time.to_s + " " + @point.to_s end |