Class: BikePOA::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/bikepoa/client.rb

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



4
5
6
7
# File 'lib/bikepoa/client.rb', line 4

def initialize
  @http_client    = HttpClient.new
  @map_parser     = MapParser.new
end

Instance Method Details

#stationsObject



9
10
11
12
13
14
# File 'lib/bikepoa/client.rb', line 9

def stations
  map_page = @http_client.fetch
  @map_parser.parse(map_page).map do |station_data|
    Station.new(station_data)
  end
end