carlosparamio-geoplanet 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -8,7 +8,7 @@ but this version supports better usage of matrix and query parameters, uses JSON
8
8
  === Searching for a Location:
9
9
 
10
10
  require 'geoplanet'
11
- GeoPlanet.app_id = [Your App ID Here]
11
+ GeoPlanet.appid = [Your App ID Here]
12
12
 
13
13
  # Search for places that matches "Springfield" (the API returns 1 by default)
14
14
  GeoPlanet::Place.search("Springfield")
@@ -24,7 +24,7 @@ but this version supports better usage of matrix and query parameters, uses JSON
24
24
  === Initializing by Where On Earth ID && Associations
25
25
 
26
26
  require 'geoplanet'
27
- GeoPlanet.app_id = [Your App ID Here]
27
+ GeoPlanet.appid = [Your App ID Here]
28
28
 
29
29
  a = GeoPlanet::Place.new(752067) # WoE ID for Algeciras
30
30
 
data/geoplanet.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "geoplanet"
3
- s.version = "0.1.3"
3
+ s.version = "0.1.4"
4
4
  s.date = "2009-02-26"
5
5
  s.summary = "A Ruby wrapper for the Yahoo! GeoPlanet API."
6
6
  s.email = "carlosparamio@gmail.com"
@@ -13,7 +13,7 @@ module GeoPlanet
13
13
  raise ArgumentError, "appid or q filter missing" if query_params[:appid].nil? || resource_path == 'places' && filters[:q].nil? # required
14
14
 
15
15
  q = ".q('#{filters[:q]}')" if filters[:q]
16
- type = ".type('#{filters[:type].is_a?(Array) ? filters[:type].to_a.join(',') : filters[:type]}')" if filters[:type]
16
+ type = ".type('#{filters[:type]}')" if filters[:type]
17
17
 
18
18
  query_string = q && type ? "$and(#{q},#{type})" : "#{q}#{type}"
19
19
 
@@ -58,7 +58,8 @@ module GeoPlanet
58
58
 
59
59
  def extract_filters(options)
60
60
  filters = %w(q type)
61
- Hash[*(options.select{|k,v| filters.include?(k.to_s)}).flatten(1)]
61
+ options[:type] = options[:type].join(",") if options[:type].is_a?(Array)
62
+ Hash[*(options.select{|k,v| filters.include?(k.to_s)}).flatten]
62
63
  end
63
64
 
64
65
  def extract_matrix_params(options)
@@ -2,7 +2,7 @@ module GeoPlanet
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carlosparamio-geoplanet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Paramio