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 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
- def base_currency
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
- def blacklist
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
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.2.18'
2
+ VERSION = '0.2.19'
3
3
  end
@@ -9,6 +9,12 @@ module Kosher
9
9
  @offer.shipping = Shipping.new
10
10
  end
11
11
 
12
+ describe "#base_currency" do
13
+ it "defaults to EUR" do
14
+ @offer.base_currency.should eql 'EUR'
15
+ end
16
+ end
17
+
12
18
  describe "#kosher?" do
13
19
  context "when item is kosher" do
14
20
  before do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kosher
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.18
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-17 00:00:00 +00:00
13
+ date: 2011-03-19 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency