Class: Yapi::OpenLocalPlatform::GeoCoder
- Inherits:
-
Object
- Object
- Yapi::OpenLocalPlatform::GeoCoder
- Defined in:
- lib/yapi/open_local_platform.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #configure(options = {}) ⇒ Object
- #geoCoder ⇒ Object
-
#initialize(api_key) ⇒ GeoCoder
constructor
A new instance of GeoCoder.
Constructor Details
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
8 9 10 |
# File 'lib/yapi/open_local_platform.rb', line 8 def config @config end |
Instance Method Details
#configure(options = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/yapi/open_local_platform.rb', line 15 def configure( = {}) .each do |key, value| self.config[key] = value end end |
#geoCoder ⇒ Object
21 22 23 24 |
# File 'lib/yapi/open_local_platform.rb', line 21 def geoCoder req_url = "https://map.yahooapis.jp/geocode/V1/geoCoder?appid=#{@client.get_api_key}#{@client.build_url(self.config)}" return @client.xml_to_json(open(URI.encode(req_url)).read) end |