Class: ArelExtensions::Nodes::Case

Inherits:
Arel::Nodes::Case
  • Object
show all
Defined in:
lib/arel_extensions/nodes/case.rb,
lib/arel_extensions/nodes/case.rb

Defined Under Namespace

Classes: Else, When

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression = nil, default = nil) ⇒ Case

Returns a new instance of Case.



7
8
9
10
11
# File 'lib/arel_extensions/nodes/case.rb', line 7

def initialize expression = nil, default = nil
  @case = expression
  @conditions = []
  @default = default
end

Instance Attribute Details

#caseObject

Returns the value of attribute case.



5
6
7
# File 'lib/arel_extensions/nodes/case.rb', line 5

def case
  @case
end

#conditionsObject

Returns the value of attribute conditions.



5
6
7
# File 'lib/arel_extensions/nodes/case.rb', line 5

def conditions
  @conditions
end

#defaultObject

Returns the value of attribute default.



5
6
7
# File 'lib/arel_extensions/nodes/case.rb', line 5

def default
  @default
end