Class: Sequel::SQL::CaseExpression

Class | Sequel::SQL::CaseExpression
In: | lib/sequel/sql.rb
Parent: | GenericExpression

Represents an SQL CASE expression, used for conditions.

### Methods

new

### Attributes

conditions | [R] | An array of all two pairs with the first element specifying the condition and the second element specifying the result.
default | [R] | The default value if no conditions are true
expression | [R] | The expression to test the conditions against

### Public Class methods

new(conditions, default, expression = nil)

Create an object with the given conditions and default value.

[Source]

         # File lib/sequel/sql.rb, line 496
    496:       def initialize(conditions, default, expression = nil)
    497:         raise(Sequel::Error, 'CaseExpression conditions must be a hash or array of all two pairs') unless Sequel.condition_specifier?(conditions)
    498:         @conditions, @default, @expression = conditions.to_a, default, expression
    499:       end

[Validate]