ocelot 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ocelot.rb +19 -2
- data/ocelot.gemspec +1 -1
- metadata +2 -2
data/lib/ocelot.rb
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
module Ocelot
|
2
|
+
class Pair
|
3
|
+
attr_accessor :a
|
4
|
+
attr_accessor :b
|
5
|
+
|
6
|
+
def initialize(a,b)
|
7
|
+
self.a = a
|
8
|
+
self.b = b
|
9
|
+
end
|
10
|
+
|
11
|
+
def hash
|
12
|
+
return a.hash * 31 + b.hash
|
13
|
+
end
|
14
|
+
|
15
|
+
def eql?(o)
|
16
|
+
o.a.eql? a and o.b.eql? b
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
2
20
|
class Base
|
3
21
|
|
4
22
|
def connection
|
@@ -60,9 +78,8 @@ module Ocelot
|
|
60
78
|
end
|
61
79
|
end
|
62
80
|
|
63
|
-
# this should really be a class-id pair store instead of the entire object,
|
64
|
-
# /maybe/
|
65
81
|
def in?(set, node)
|
82
|
+
node = Pair.new(node.class, node.id)
|
66
83
|
result = set.include? node
|
67
84
|
set << node
|
68
85
|
result
|
data/ocelot.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ocelot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- spencer p
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-04 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|