kosher 0.2.18 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kosher/offer.rb +3 -9
- data/lib/kosher/seller.rb +4 -9
- data/lib/kosher/version.rb +1 -1
- data/spec/kosher/offer_spec.rb +6 -0
- metadata +2 -2
data/lib/kosher/offer.rb
CHANGED
@@ -2,18 +2,12 @@ module Kosher
|
|
2
2
|
class Offer < Struct.new(:id, :item, :seller, :shipping)
|
3
3
|
include Comparable
|
4
4
|
|
5
|
-
BASE_CURRENCY = 'EUR'
|
6
|
-
|
7
5
|
class << self
|
8
|
-
|
9
|
-
@base_currency ||= BASE_CURRENCY
|
10
|
-
end
|
11
|
-
|
12
|
-
def base_currency=(currency)
|
13
|
-
@base_currency = currency
|
14
|
-
end
|
6
|
+
attr_accessor :base_currency
|
15
7
|
end
|
16
8
|
|
9
|
+
self.base_currency = 'EUR'
|
10
|
+
|
17
11
|
def <=>(other)
|
18
12
|
if self.kosher? != other.kosher?
|
19
13
|
self.kosher? ? -1 : 1
|
data/lib/kosher/seller.rb
CHANGED
@@ -2,18 +2,13 @@ module Kosher
|
|
2
2
|
class Seller < Struct.new(:id, :name, :rating, :location)
|
3
3
|
include Threshold
|
4
4
|
|
5
|
-
self.threshold = 4.8
|
6
|
-
|
7
5
|
class << self
|
8
|
-
|
9
|
-
@blacklist ||= []
|
10
|
-
end
|
11
|
-
|
12
|
-
def blacklist=(ids)
|
13
|
-
@blacklist = ids
|
14
|
-
end
|
6
|
+
attr_accessor :blacklist
|
15
7
|
end
|
16
8
|
|
9
|
+
self.threshold = 4.8
|
10
|
+
self.blacklist = []
|
11
|
+
|
17
12
|
def blacklist
|
18
13
|
self.class.blacklist
|
19
14
|
end
|
data/lib/kosher/version.rb
CHANGED
data/spec/kosher/offer_spec.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: kosher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.19
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paper Cavalier
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-19 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|