Class: Hash

Class | Hash
In: | lib/sequel_core/core_ext.rb lib/sequel_core/core_sql.rb
Parent: | Object

### Methods

& case sql_expr sql_negate sql_or | ~

### External Aliases

index | -> | key

### Public Instance methods

&(ce)

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.

[Source]

        # File lib/sequel_core/core_sql.rb, line 77
    77:   def &(ce)
    78:     ::Sequel::SQL::BooleanExpression.new(:AND, self, ce)
    79:   end

case(default, expression = nil)

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.

[Source]

        # File lib/sequel_core/core_sql.rb, line 97
    97:   def case(default, expression = nil)
    98:     ::Sequel::SQL::CaseExpression.new(to_a, default, expression)
    99:   end

sql_expr()

Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions.

[Source]

         # File lib/sequel_core/core_sql.rb, line 103
    103:   def sql_expr
    104:     ::Sequel::SQL::BooleanExpression.from_value_pairs(self)
    105:   end

sql_negate()

Return a Sequel::SQL::BooleanExpression created from this hash, matching none of the conditions.

[Source]

         # File lib/sequel_core/core_sql.rb, line 109
    109:   def sql_negate
    110:     ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :AND, true)
    111:   end

sql_or()

Return a Sequel::SQL::BooleanExpression created from this hash, matching any of the conditions.

[Source]

         # File lib/sequel_core/core_sql.rb, line 115
    115:   def sql_or
    116:     ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :OR)
    117:   end

|(ce)

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.

[Source]

        # File lib/sequel_core/core_sql.rb, line 84
    84:   def |(ce)
    85:     ::Sequel::SQL::BooleanExpression.new(:OR, self, ce)
    86:   end

~()

Return a Sequel::SQL::BooleanExpression created from this hash, not matching any of the conditions.

[Source]

        # File lib/sequel_core/core_sql.rb, line 90
    90:   def ~
    91:     ::Sequel::SQL::BooleanExpression.from_value_pairs(self, :OR, true)
    92:   end

[Validate]