Revisions

gist: 224713 Download_button fork
public
Public Clone URL: git://gist.github.com/224713.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
>> a = [1, 2, 3]
=> [1, 2, 3]
>> o = Odb::Object.write(a)
=> 4
>> Odb::Object.read(4)
=> <Odb::Proxy::Array [object_id:1, object_id:2, object_id:3]>
>> Odb::Object.read(4)[2]
=> 3
>> Odb::Object.read(4)[2]
=> 3
>> Odb::Object.read(4)[1]
=> 2
>> Odb::Object.read(4)[0]
=> 1
>> Odb::Object.read(4)[3]
TypeError: no implicit conversion from nil to integer
from /Users/scotttaylor/src/git/odb/lib/odb/object_id_file.rb:8:in `[]'
from /Users/scotttaylor/src/git/odb/lib/odb/object_id_file.rb:8:in `read'
from /Users/scotttaylor/src/git/odb/lib/odb/object.rb:16:in `read'
from /Users/scotttaylor/src/git/odb/lib/odb/object.rb:7:in `read'
from /Users/scotttaylor/src/git/odb/lib/odb/proxy/array.rb:62:in `lookup_element'
from /Users/scotttaylor/src/git/odb/lib/odb/proxy/array.rb:24:in `[]'
from (irb):15