Class | Sequel::SQL::CaseExpression |
In: |
lib/sequel_core/sql.rb
|
Parent: | GenericExpression |
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 |
Create an object with the given conditions and default value.
# File lib/sequel_core/sql.rb, line 507 507: def initialize(conditions, default, expression = nil) 508: raise(Sequel::Error, 'CaseExpression conditions must be an array with all_two_pairs') unless Array === conditions and conditions.all_two_pairs? 509: @conditions, @default, @expression = conditions, default, expression 510: end