Class: Hash
Direct Known Subclasses
Sequel::Model::Associations::AssociationReflection, Sequel::Model::Errors
Instance Method Summary collapse
-
#&(ce) ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions in this hash and the condition specified by the given argument.
-
#case(default, expression = nil) ⇒ Object
Return a Sequel::SQL::CaseExpression with this hash as the conditions and the given default value.
-
#sql_expr ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions.
-
#sql_negate ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching none of the conditions.
-
#sql_or ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching any of the conditions.
-
#|(ce) ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions in this hash or the condition specified by the given argument.
-
#~ ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, not matching any of the conditions.
Instance Method Details
#&(ce) ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions in this hash and the condition specified by the given argument.
80 81 82 |
# File 'lib/sequel/core_sql.rb', line 80 def &(ce) ::Sequel::SQL::BooleanExpression.new(:AND, self, ce) end |
#case(default, expression = nil) ⇒ Object
Return a Sequel::SQL::CaseExpression with this hash as the conditions and the given default value. Note that the order of the conditions will be arbitrary, so all conditions should be orthogonal.
100 101 102 |
# File 'lib/sequel/core_sql.rb', line 100 def case(default, expression = nil) ::Sequel::SQL::CaseExpression.new(to_a, default, expression) end |
#sql_expr ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions.
106 107 108 |
# File 'lib/sequel/core_sql.rb', line 106 def sql_expr ::Sequel::SQL::BooleanExpression.from_value_pairs(self) end |
#sql_negate ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching none of the conditions.
112 113 114 |
# File 'lib/sequel/core_sql.rb', line 112 def sql_negate ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :AND, true) end |
#sql_or ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching any of the conditions.
118 119 120 |
# File 'lib/sequel/core_sql.rb', line 118 def sql_or ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :OR) end |
#|(ce) ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions in this hash or the condition specified by the given argument.
87 88 89 |
# File 'lib/sequel/core_sql.rb', line 87 def |(ce) ::Sequel::SQL::BooleanExpression.new(:OR, self, ce) end |
#~ ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, not matching any of the conditions.
93 94 95 |
# File 'lib/sequel/core_sql.rb', line 93 def ~ ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :OR, true) end |