Class: BuBus::Bus

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

Constant Summary collapse

URL =
"http://www.bu.edu/bumobile/rpc/bus/livebus.json.php"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bus_hash) ⇒ Bus

Returns a new instance of Bus.



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

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.



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

def call_name
  @call_name
end

#coordinatesObject

Returns the value of attribute coordinates.



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

def coordinates
  @coordinates
end

#general_headingObject

Returns the value of attribute general_heading.



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

def general_heading
  @general_heading
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#latObject

Returns the value of attribute lat.



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

def lat
  @lat
end

#lngObject

Returns the value of attribute lng.



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

def lng
  @lng
end

#speedObject

Returns the value of attribute speed.



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

def speed
  @speed
end