kosher 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kosher/offer.rb +13 -5
- data/lib/kosher/version.rb +1 -1
- metadata +1 -1
data/lib/kosher/offer.rb
CHANGED
@@ -2,6 +2,18 @@ module Kosher
|
|
2
2
|
class Offer < Struct.new(:id, :item, :seller, :shipping)
|
3
3
|
include Comparable
|
4
4
|
|
5
|
+
BASE_CURRENCY = 'EUR'
|
6
|
+
|
7
|
+
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
|
15
|
+
end
|
16
|
+
|
5
17
|
def <=>(other)
|
6
18
|
if self.kosher? != other.kosher?
|
7
19
|
self.kosher? ? -1 : 1
|
@@ -11,11 +23,7 @@ module Kosher
|
|
11
23
|
end
|
12
24
|
|
13
25
|
def base_currency
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def base_currency=(currency)
|
18
|
-
@base_currency = currency
|
26
|
+
self.class.base_currency
|
19
27
|
end
|
20
28
|
|
21
29
|
def kosher?
|
data/lib/kosher/version.rb
CHANGED