thinknear 0.0.7 → 0.0.8

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -2,7 +2,11 @@ module ThinkNear
2
2
  class Offer < OpenStruct
3
3
  def self.find(id_or_params)
4
4
  if id_or_params.is_a? String
5
- new Client.get_offer(id_or_params)['offer']
5
+ if params = Client.get_offer(id_or_params)['offer']
6
+ new(params)
7
+ else
8
+ raise OfferNotFound, "Couldn't find Offer with ID=#{id_or_params}"
9
+ end
6
10
  elsif id_or_params.is_a? Hash
7
11
  Client.get_offers(id_or_params).map do |item|
8
12
  new item['offer']
data/lib/think_near.rb CHANGED
@@ -15,6 +15,7 @@ module ThinkNear
15
15
  class ThinkNearError < StandardError; end
16
16
  class Unauthorized < ThinkNearError; end
17
17
  class NotFound < ThinkNearError; end
18
+ class OfferNotFound < ThinkNearError; end
18
19
  class ServerError < ThinkNearError; end
19
20
  class Unavailable < ThinkNearError; end
20
21
  class DecodeError < ThinkNearError; end
data/thinknear.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{thinknear}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Denis Barushev"]
12
- s.date = %q{2011-03-25}
12
+ s.date = %q{2011-03-28}
13
13
  s.email = %q{barushev@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: thinknear
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Denis Barushev
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-25 00:00:00 +02:00
13
+ date: 2011-03-28 00:00:00 +03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -128,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- hash: 2003740883839399333
131
+ hash: 3290331615421976596
132
132
  segments:
133
133
  - 0
134
134
  version: "0"