From 960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Sun, 30 Dec 2007 11:35:44 -0800 Subject: initial import --- lib/sql_algebra/sql/select.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/sql_algebra/sql/select.rb (limited to 'lib/sql_algebra/sql') diff --git a/lib/sql_algebra/sql/select.rb b/lib/sql_algebra/sql/select.rb new file mode 100644 index 0000000000..da92ad3a52 --- /dev/null +++ b/lib/sql_algebra/sql/select.rb @@ -0,0 +1,23 @@ +class Select + attr_reader :attributes, :tables, :predicates + + def initialize(*attributes) + @attributes = attributes + end + + def from(*tables) + returning self do |select| + @tables = tables + end + end + + def where(*predicates) + returning self do |select| + @predicates = predicates + end + end + + def ==(other) + attributes == other.attributes and tables == other.tables and predicates == other.predicates + end +end \ No newline at end of file -- cgit v1.2.3