ocelot 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ocelot.rb +19 -2
  2. data/ocelot.gemspec +1 -1
  3. 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
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ocelot"
6
- s.version = "0.0.5"
6
+ s.version = "0.0.6"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["spencer p"]
9
9
  s.email = ["exussum@gmail.com"]
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
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-05-10 00:00:00 -04:00
13
+ date: 2011-06-04 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16