rvista 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/rvista/poa_line_item.rb +17 -0
- data/test/unit/poa_line_item_test.rb +5 -0
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/rvista/poa_line_item.rb
CHANGED
@@ -12,6 +12,19 @@ module RVista
|
|
12
12
|
attr_accessor :status_code, :demand_qty, :rrp, :discount_percent
|
13
13
|
attr_accessor :availability_date, :text
|
14
14
|
|
15
|
+
STATUS = {
|
16
|
+
1 => "Shipped as ordered",
|
17
|
+
2 => "Title substituted",
|
18
|
+
6 => "Out of stock – reprinting",
|
19
|
+
7 => "Back ordered",
|
20
|
+
9 => "Part supply",
|
21
|
+
10 => "Part back ordered",
|
22
|
+
15 => "Market restricted",
|
23
|
+
27 => "ISBN not recognised",
|
24
|
+
28 => "Out of print",
|
25
|
+
29 => "Customer backordered"
|
26
|
+
}
|
27
|
+
|
15
28
|
# returns a new RVista::POALineItem object using the data passed in as an
|
16
29
|
# array. The array should have exactly 14 items in it. Refer to the Vista
|
17
30
|
# standard to see what those 14 items should be.
|
@@ -37,6 +50,10 @@ module RVista
|
|
37
50
|
|
38
51
|
return item
|
39
52
|
end
|
53
|
+
|
54
|
+
def status_text
|
55
|
+
STATUS[status_code.to_i]
|
56
|
+
end
|
40
57
|
|
41
58
|
# output a string that represents this line item that meets the vista spec
|
42
59
|
def to_s
|
@@ -62,6 +62,11 @@ class POALineItemTest < Test::Unit::TestCase
|
|
62
62
|
|
63
63
|
end
|
64
64
|
|
65
|
+
def test_status_text
|
66
|
+
item = RVista::POALineItem.load_from_array(@row)
|
67
|
+
assert_equal item.status_text, "Shipped as ordered"
|
68
|
+
end
|
69
|
+
|
65
70
|
def test_to_s
|
66
71
|
item = RVista::POALineItem.load_from_array(@row)
|
67
72
|
str = item.to_s
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rvista
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Healy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-07-
|
12
|
+
date: 2008-07-04 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|