orders 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -13,3 +13,7 @@
13
13
  == 0.0.3 / 2011-03-19
14
14
 
15
15
  * Feature-parity with legacy code
16
+
17
+ == 0.0.4 / 2011-03-21
18
+
19
+ * Item#to_s added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -15,5 +15,11 @@ module Orders
15
15
  def initialize opts = {}
16
16
  opts.each {|key, value| send "#{key}=", value}
17
17
  end
18
+
19
+ def inspect
20
+ "#{id}:#{price}>#{volume}#{buysell == 1 ? '+' : '-'}"
21
+ end
22
+
23
+ alias to_s inspect
18
24
  end
19
25
  end
@@ -30,6 +30,13 @@ describe Orders::OrderBookItem do
30
30
  its (:volume) {should == 12345}
31
31
  its (:buysell) {should == 1}
32
32
  its (:order_book) {should == 123456}
33
+
34
+ describe '#to_s, #inspect' do
35
+ it 'is just right' do
36
+ subject.to_s.should == "12:1234>12345+"
37
+ subject.inspect.should == "12:1234>12345+"
38
+ end
39
+ end
33
40
  end
34
41
  end
35
42
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: orders
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - arvicco
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-19 00:00:00 +03:00
13
+ date: 2011-03-21 00:00:00 +03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency