Class: BuBus::Bus
- Inherits:
-
Object
- Object
- BuBus::Bus
- Defined in:
- lib/bubus/bus.rb
Constant Summary collapse
- URL =
"http://www.bu.edu/bumobile/rpc/bus/livebus.json.php"
Instance Attribute Summary collapse
-
#call_name ⇒ Object
Returns the value of attribute call_name.
-
#coordinates ⇒ Object
Returns the value of attribute coordinates.
-
#general_heading ⇒ Object
Returns the value of attribute general_heading.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lng ⇒ Object
Returns the value of attribute lng.
-
#speed ⇒ Object
Returns the value of attribute speed.
Instance Method Summary collapse
-
#initialize(bus_hash) ⇒ Bus
constructor
A new instance of Bus.
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_name ⇒ Object
Returns the value of attribute call_name.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def call_name @call_name end |
#coordinates ⇒ Object
Returns the value of attribute coordinates.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def coordinates @coordinates end |
#general_heading ⇒ Object
Returns the value of attribute general_heading.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def general_heading @general_heading end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def id @id end |
#lat ⇒ Object
Returns the value of attribute lat.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def lat @lat end |
#lng ⇒ Object
Returns the value of attribute lng.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def lng @lng end |
#speed ⇒ Object
Returns the value of attribute speed.
3 4 5 |
# File 'lib/bubus/bus.rb', line 3 def speed @speed end |