Class: Sample

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pointObject (readonly)

Returns the value of attribute point.



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

def point
  @point
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#latObject



18
19
20
# File 'lib/sample.rb', line 18

def lat
  point.lat
end

#longObject



22
23
24
# File 'lib/sample.rb', line 22

def long
  point.long
end

#to_sObject



14
15
16
# File 'lib/sample.rb', line 14

def to_s
  @time.to_s + " " + @point.to_s 
end