Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1822c9
commit 92bb8a7
Showing
10 changed files
with
139 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Guillotine | ||
module Expressions | ||
class Equal < Base | ||
RUBY_OPERATOR = :== | ||
SQL_OPERATOR = "=" | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(RUBY_OPERATOR) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Guillotine | ||
module Expressions | ||
class GreaterThan < Base | ||
RUBY_OPERATOR = :> | ||
SQL_OPERATOR = RUBY_OPERATOR.to_s | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(RUBY_OPERATOR) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Guillotine | ||
module Expressions | ||
class GreaterThanOrEqualTo < Base | ||
RUBY_OPERATOR = :>= | ||
SQL_OPERATOR = RUBY_OPERATOR.to_s | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(RUBY_OPERATOR) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Guillotine | ||
module Expressions | ||
class IsNotNull < IsNull | ||
SQL_OPERATOR = "IS NOT NULL" | ||
|
||
def to_lambda | ||
lambda { |obj| ! super.call(obj) } | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Guillotine | ||
module Expressions | ||
class IsNull < Base | ||
RUBY_OPERATOR = :nil? | ||
SQL_OPERATOR = "IS NULL" | ||
|
||
def initialize(key) | ||
super(key, nil) | ||
end | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(:==) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Guillotine | ||
module Expressions | ||
class LessThan < Base | ||
RUBY_OPERATOR = :< | ||
SQL_OPERATOR = RUBY_OPERATOR.to_s | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(RUBY_OPERATOR) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Guillotine | ||
module Expressions | ||
class LessThanOrEqualTo < Base | ||
RUBY_OPERATOR = :<= | ||
SQL_OPERATOR = RUBY_OPERATOR.to_s | ||
|
||
def to_lambda | ||
new_lambda_with_comparison(RUBY_OPERATOR) | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Guillotine | ||
module Expressions | ||
class NotEqual < Equal | ||
SQL_OPERATOR = "!=" | ||
|
||
def to_lambda | ||
lambda { |obj| ! super.call(obj) } | ||
end | ||
|
||
def to_sql | ||
"#{key} #{SQL_OPERATOR} #{value}" | ||
end | ||
end | ||
end | ||
end |