Methods

Class/Module Index [+]

Quicksearch

Sequel::SQL::CaseExpression

Represents an SQL CASE expression, used for conditions.

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) click to toggle source

Create an object with the given conditions and default value.

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.