Class: CloudMade::Service
- Inherits:
-
Object
- Object
- CloudMade::Service
- Defined in:
- lib/cloudmade/service.rb
Overview
General class for all CloudMade’s services
Direct Known Subclasses
GeocodingService, LocationsService, RoutingService, TilesService
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
Class Method Summary collapse
Instance Method Summary collapse
-
#url ⇒ Object
Template for service’s domain By default it is <service_name>.cloudmade.com E.g.
- #url_template ⇒ Object
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
24 25 26 |
# File 'lib/cloudmade/service.rb', line 24 def connection @connection end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
23 24 25 |
# File 'lib/cloudmade/service.rb', line 23 def subdomain @subdomain end |
Class Method Details
.to_url_params(params) ⇒ Object
38 39 40 |
# File 'lib/cloudmade/service.rb', line 38 def to_url_params(params) params.map {|k,v| "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" }.join('&') end |
Instance Method Details
#url ⇒ Object
Template for service’s domain By default it is <service_name>.cloudmade.com E.g. tile.cloudmade.com, geocoding.cloudmade.com
33 34 35 |
# File 'lib/cloudmade/service.rb', line 33 def url "#{@subdomain}.#{@connection.base_url}" end |
#url_template ⇒ Object
26 27 28 |
# File 'lib/cloudmade/service.rb', line 26 def url_template return "http://#{@subdomain}.#{@connection.url}/#{@connection.api_key}" end |