mattt-yahoo-geoplanet 0.1.0 → 0.2.0

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.
@@ -16,8 +16,15 @@ module Yahoo
16
16
  end
17
17
 
18
18
  def api_path(resource, id, collection, *args)
19
+ args = args.extract_options!
20
+ count = args.delete(:count)
21
+ start = args.delete(:start)
22
+ collection += ";count=#{count}" if count
23
+ collection += ";start=#{start}" if start
24
+
19
25
  parameters = [resource, id, collection, *args].compact
20
- return parameters.collect!{|param| CGI::escape(param.to_s).downcase}.join('/')
26
+ # return parameters.collect!{|param| CGI::escape(param.to_s).downcase}.join('/')
27
+ return parameters.collect!{|param| param.to_s.downcase}.join('/')
21
28
  end
22
29
  end
23
30
 
@@ -39,8 +39,8 @@ module Yahoo
39
39
 
40
40
  # Association Collections
41
41
  ["parent", "ancestors", "belongtos", "neighbors", "siblings", "children"].each do |association|
42
- define_method(association.to_sym) do
43
- xml = self.class.fetch_and_parse(self.class.api_path(self.class.name, @woe_id, association), :select => :long)
42
+ define_method(association.to_sym) do |*options|
43
+ xml = self.class.fetch_and_parse(self.class.api_path(self.class.name, @woe_id, association, *options), :select => :long)
44
44
  value = xml.search(self.class.name.downcase).collect{|elem| self.class.new(elem)}
45
45
  return association.singularize == association ? value.first : value
46
46
  end
@@ -2,7 +2,7 @@ module Yahoo
2
2
  module GeoPlanet
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
- MINOR = 1
5
+ MINOR = 2
6
6
  TINY = 0
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "yahoo-geoplanet"
3
- s.version = "0.1.0"
3
+ s.version = "0.2.0"
4
4
  s.date = "2008-11-13"
5
5
  s.summary = "A Ruby wrapper for the Yahoo! GeoPlanet API."
6
6
  s.email = "mail@matttthompson.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mattt-yahoo-geoplanet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
@@ -14,6 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hpricot
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -23,6 +24,7 @@ dependencies:
23
24
  version:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: activesupport
27
+ type: :runtime
26
28
  version_requirement:
27
29
  version_requirements: !ruby/object:Gem::Requirement
28
30
  requirements: