Class: Bmtc::TTMC

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ TTMC

Returns a new instance of TTMC.



4
5
6
7
# File 'lib/bmtc/ttmc.rb', line 4

def initialize(options = {})
  @id = options['id']
  @name = options['ttmcName']
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Class Method Details

.allObject



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