Class: Bus

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bus_hash) ⇒ Bus

Returns a new instance of Bus.



4
5
6
7
8
9
10
11
12
# File 'lib/bubus/bus.rb', line 4

def initialize(bus_hash)
  @call_name = bus_hash["call_name"]
  @coordinates = bus_hash["coordinates"]
  @general_heading = bus_hash["general_heading"]
  @id = bus_hash["id"]
  @speed = bus_hash["speed"]
  @lat = bus_hash["lat"]
  @lng = bus_hash["lng"]
end

Instance Attribute Details

#call_nameObject

Returns the value of attribute call_name.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def call_name
  @call_name
end

#coordinatesObject

Returns the value of attribute coordinates.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def coordinates
  @coordinates
end

#general_headingObject

Returns the value of attribute general_heading.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def general_heading
  @general_heading
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def id
  @id
end

#latObject

Returns the value of attribute lat.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def lat
  @lat
end

#lngObject

Returns the value of attribute lng.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def lng
  @lng
end

#speedObject

Returns the value of attribute speed.



2
3
4
# File 'lib/bubus/bus.rb', line 2

def speed
  @speed
end