petfinder 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b255d17aefed3516c45591c66c83e06052e923a1
4
- data.tar.gz: 6fa5e53647920ed44c91ce602416b7795640fd2e
3
+ metadata.gz: 5928d4748c4cdaad2d5b4bbe79d5aa687854a9ea
4
+ data.tar.gz: ccfee75e913be832d68e2dd13ad0b8e4f5afeac1
5
5
  SHA512:
6
- metadata.gz: aea560646c6394909be26837245cc36b4c0e5593215dce4f5bb5f1b409aab61e60dbf220202721ad5b21adf01f30d06348a78113e41eff18c4567891d541766f
7
- data.tar.gz: c3e18028c919a05df75a387371f08b1cec10b86c0674017c8866d9a8cf1159b8dce6cf752a50ccf93c52f7a731ad51f4ff42c42891f7be9eaa74bed130d8d2c1
6
+ metadata.gz: 3bfc6c8849b64235a3ccefb6403c105bcae2098ea0ea9941b163d858db85d00babc49c7b13bb22e72118b0d0638fb771b820d0193c0404551ff1877c23e39a9a
7
+ data.tar.gz: 70246ee98b0e6615018cbac4d24644c7435534435c6c9e672dee6599f1c8075d36eb943f1147aeba2185f80ad41a628003f5fd894f06fdbc0902364d3324942d
@@ -1,3 +1,7 @@
1
+ 1.0.3
2
+ -----
3
+ * Adding inspect methods and rake console tasks (JessSumner)
4
+
1
5
  1.0.2
2
6
  -----
3
7
  * Add contact object to pet (lynnaloo)
data/README.md CHANGED
@@ -59,6 +59,21 @@ pets.first.shelterid
59
59
  # => "CA123"
60
60
  ```
61
61
 
62
+ #### Returning paged results
63
+
64
+ ```ruby
65
+ petfinder.find_pets('dog', 77057, count: 25)
66
+
67
+ # page 2
68
+ petfinder.find_pets('dog', 77057, count: 25, offset: 25)
69
+
70
+ # page 3
71
+ petfinder.find_pets('dog', 77057, count: 25, offset: 50)
72
+
73
+ # page 4
74
+ petfinder.find_pets('dog', 77057, count: 25, offset: 75)
75
+ ```
76
+
62
77
  #### Return information about the shelter with id "CA123"
63
78
 
64
79
  ```ruby
@@ -82,7 +97,7 @@ pets = petfinder.find_pets(animal_type, location, options)
82
97
 
83
98
  # Options available: status, offset, count
84
99
  pets = shelter_pets(shelter_id, options)
85
-
100
+
86
101
  # Options available: name, offset, count
87
102
  shelters = petfinder.find_shelters(location, options)
88
103
  shelters = petfinder.find_shelters_by_breed(animal_type, breed)
data/Rakefile CHANGED
@@ -4,3 +4,11 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ task :console do
9
+ require "irb"
10
+ require "irb/completion"
11
+ require "petfinder"
12
+ ARGV.clear
13
+ IRB.start
14
+ end
@@ -38,6 +38,10 @@ module Petfinder
38
38
  @photos
39
39
  end
40
40
 
41
+ def inspect
42
+ "#<Pet id: '#{id}', name: '#{name}', animal: '#{animal}', mix: '#{mix}', sex: '#{sex}'>"
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def parse_photos
@@ -9,6 +9,10 @@ module Petfinder
9
9
  @xml = xml
10
10
  end
11
11
 
12
+ def inspect
13
+ "#<Shelter id: '#{id}', name: '#{name}', state: '#{state}'>"
14
+ end
15
+
12
16
  def self.multiple(xml)
13
17
  xml.xpath("//shelters/shelter").map do |node|
14
18
  Shelter.new(Nokogiri::XML(node.to_xml))
@@ -1,3 +1,3 @@
1
1
  module Petfinder
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -35,4 +35,7 @@ describe Petfinder::Pet do
35
35
  pets.should have(25).items
36
36
  end
37
37
 
38
+ it "should return a friendly inspect" do
39
+ @pet.inspect.should eq("#<Pet id: '10141994', name: 'Charlie', animal: 'Cat', mix: 'no', sex: 'M'>")
40
+ end
38
41
  end
@@ -16,5 +16,8 @@ describe Petfinder::Pet do
16
16
  shelters.should have(25).items
17
17
  end
18
18
 
19
+ it "should return a friendly inspect" do
20
+ @shelter.inspect.should eq("#<Shelter id: 'TX1356', name: 'Lucky Dog Rescue', state: 'TX'>")
21
+ end
19
22
  end
20
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petfinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hutzelman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-05 00:00:00.000000000 Z
11
+ date: 2015-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.3.0
110
+ rubygems_version: 2.4.8
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Ruby gem wrapper for the Petfinder API.