Class: Bmtc::TTMC
- Inherits:
-
Object
- Object
- Bmtc::TTMC
- Defined in:
- lib/bmtc/ttmc.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TTMC
constructor
A new instance of TTMC.
Constructor Details
#initialize(options = {}) ⇒ TTMC
Returns a new instance of TTMC.
4 5 6 7 |
# File 'lib/bmtc/ttmc.rb', line 4 def initialize( = {}) @id = ['id'] @name = ['ttmcName'] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/bmtc/ttmc.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/bmtc/ttmc.rb', line 3 def name @name end |
Class Method Details
.all ⇒ Object
9 10 11 12 |
# File 'lib/bmtc/ttmc.rb', line 9 def self.all list = JSON.parse Bmtc.get('/passengerinfo/ttmclist').body list.map { |stop| BMTC::TTMC.new(stop) } end |