Class: CloudMade::Client
- Inherits:
-
Object
- Object
- CloudMade::Client
- Defined in:
- lib/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#port ⇒ Object
:nodoc:.
Class Method Summary collapse
- .from_connection(connection) ⇒ Object
- .from_parameters(api_key, base_url = nil, port = nil) ⇒ Object
Instance Method Summary collapse
-
#geocoding ⇒ Object
Geocoding service.
-
#locations ⇒ Object
Locations service.
-
#routing ⇒ Object
Routing service.
-
#tiles ⇒ Object
Tiles service.
-
#url ⇒ Object
:nodoc:.
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
21 22 23 |
# File 'lib/client.rb', line 21 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
19 20 21 |
# File 'lib/client.rb', line 19 def base_url @base_url end |
#connection ⇒ Object
Returns the value of attribute connection.
18 19 20 |
# File 'lib/client.rb', line 18 def connection @connection end |
#port ⇒ Object
:nodoc:
30 31 32 33 |
# File 'lib/client.rb', line 30 def port return 80 if @port == nil @port end |
Class Method Details
.from_connection(connection) ⇒ Object
60 61 62 63 64 |
# File 'lib/client.rb', line 60 def from_connection(connection) client = Client.new client.connection = connection return client end |
.from_parameters(api_key, base_url = nil, port = nil) ⇒ Object
66 67 68 69 70 |
# File 'lib/client.rb', line 66 def from_parameters(api_key, base_url = nil, port = nil) client = Client.new client.connection = Connection.new(api_key, base_url, port) return client end |
Instance Method Details
#geocoding ⇒ Object
Geocoding service
42 43 44 45 |
# File 'lib/client.rb', line 42 def geocoding @geocoding = GeocodingService.new(self.connection, 'geocoding') if @geocoding == nil return @geocoding end |
#locations ⇒ Object
Locations service
54 55 56 57 |
# File 'lib/client.rb', line 54 def locations @locations = LocationsService.new(self.connection, '') if @locations == nil return @locations end |
#routing ⇒ Object
Routing service
48 49 50 51 |
# File 'lib/client.rb', line 48 def routing @routing = RoutingService.new(self.connection, 'routes') if @routing == nil return @routing end |
#tiles ⇒ Object
Tiles service
36 37 38 39 |
# File 'lib/client.rb', line 36 def tiles @tiles = TilesService.new(self.connection, 'tile') if @tiles == nil return @tiles end |
#url ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/client.rb', line 25 def url return "#{base_url}#{@port != nil ? ':' + port.to_s : ''}" end |