Skip to content

Instantly share code, notes, and snippets.

@mzsanford
Created July 28, 2010 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzsanford/493119 to your computer and use it in GitHub Desktop.
Save mzsanford/493119 to your computer and use it in GitHub Desktop.
require 'flockdb'
flock = Flock.new "localhost:7915", :graphs => { :a_to_b => 1, :b_to_c => 2 }
flock.add(1, :a_to_b, 1)
flock.add(1, :a_to_b, 2)
flock.add(1, :a_to_b, 3)
flock.add(2, :b_to_c, 1)
flock.add(2, :b_to_c, 2)
# OK
flock.select(1, :a_to_b, nil).size == flock.select(1, :a_to_b, nil).to_a.size
# Not OK, .size is 0 but to_a.size is 1
flock.select(1, :a_to_b, nil).intersect(nil, :b_to_c, 2).size == flock.select(1, :a_to_b, nil).intersect(nil, :b_to_c, 2).to_a.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment