Module: WMATA

Defined in:
lib/client.rb,
lib/ruby_wmata.rb

Defined Under Namespace

Classes: Client

Class Method Summary collapse

Class Method Details

.apiObject



9
10
11
# File 'lib/ruby_wmata.rb', line 9

def self.api
  @api || raise("please set the api key")
end

.api=(api_key) ⇒ Object



13
14
15
16
# File 'lib/ruby_wmata.rb', line 13

def self.api=(api_key)
  @client = Client.new(api_key)
  @api = api_key
end

.clientObject



5
6
7
# File 'lib/ruby_wmata.rb', line 5

def self.client
  @client ||= Client.new(api)
end

.next_trains(station = "A06") ⇒ Object



18
19
20
# File 'lib/ruby_wmata.rb', line 18

def self.next_trains(station = "A06")
  client.next_trains(station)
end

.train_incidentsObject



30
31
32
# File 'lib/ruby_wmata.rb', line 30

def self.train_incidents
  client.train_incidents
end

.train_path(from, to) ⇒ Object



26
27
28
# File 'lib/ruby_wmata.rb', line 26

def self.train_path(from,to)
  client.train_path(from,to)
end

.train_stations(line = 'RD') ⇒ Object



22
23
24
# File 'lib/ruby_wmata.rb', line 22

def self.train_stations(line = 'RD')
  client.train_stations(line)
end