Skip to content

Instantly share code, notes, and snippets.

@alexisbernard
Created September 7, 2010 07:07
Show Gist options
  • Save alexisbernard/567979 to your computer and use it in GitHub Desktop.
Save alexisbernard/567979 to your computer and use it in GitHub Desktop.
$LOAD_PATH.unshift '/home/alexis/veritas/lib'
require 'veritas'
include Veritas
header = Relation::Header.new([[:name, String], [:is_admin, Integer], [:is_author, Integer]])
body = [['Foo', 1, 1], ['Bar', 1, 0], ['Baz', 0, 1]].each
users = Relation.new(header, body)
admins = Relation.new(header, body).restrict { |r| r[:is_admin].eq(1) }
authors = Relation.new(header, body).restrict { |r| r[:is_author].eq(1) }
users & authors - admins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment