Class: CloudMade::Client
- Inherits:
-
Object
- Object
- CloudMade::Client
- Defined in:
- lib/cloudmade/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/cloudmade/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/cloudmade/client.rb', line 19 def base_url @base_url end |
#connection ⇒ Object
Returns the value of attribute connection.
18 19 20 |
# File 'lib/cloudmade/client.rb', line 18 def connection @connection end |
#port ⇒ Object
:nodoc:
30 31 32 33 |
# File 'lib/cloudmade/client.rb', line 30 def port return 80 if @port == nil @port end |
Class Method Details
.from_connection(connection) ⇒ Object
56 57 58 59 60 |
# File 'lib/cloudmade/client.rb', line 56 def from_connection(connection) client = Client.new client.connection = connection return client end |
.from_parameters(api_key, base_url = nil, port = nil) ⇒ Object
62 63 64 65 66 |
# File 'lib/cloudmade/client.rb', line 62 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
41 42 43 |
# File 'lib/cloudmade/client.rb', line 41 def geocoding @geocoding ||= GeocodingService.new(self.connection, 'geocoding') end |
#locations ⇒ Object
Locations service
51 52 53 |
# File 'lib/cloudmade/client.rb', line 51 def locations @locations ||= LocationsService.new(self.connection, '') end |
#routing ⇒ Object
Routing service
46 47 48 |
# File 'lib/cloudmade/client.rb', line 46 def routing @routing ||= RoutingService.new(self.connection, 'routes') end |
#tiles ⇒ Object
Tiles service
36 37 38 |
# File 'lib/cloudmade/client.rb', line 36 def tiles @tiles ||= TilesService.new(self.connection, 'tile') end |
#url ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/cloudmade/client.rb', line 25 def url return "#{base_url}#{@port != nil ? ':' + port.to_s : ''}" end |