Class: Vertigo::Case

Inherits:
AstNode show all
Defined in:
lib/vertigo/ast.rb,
lib/vertigo/ast_vertigo_rkgen.rb

Instance Attribute Summary collapse

Attributes inherited from AstNode

#label, #pos

Instance Method Summary collapse

Methods inherited from AstNode

#accept, #str

Constructor Details

#initialize(expr = nil, whens = []) ⇒ Case

Returns a new instance of Case.



253
254
255
# File 'lib/vertigo/ast_vertigo_rkgen.rb', line 253

def initialize expr=nil,whens=[]
  @expr,@whens=expr,whens
end

Instance Attribute Details

#exprObject

Returns the value of attribute expr.



252
253
254
# File 'lib/vertigo/ast_vertigo_rkgen.rb', line 252

def expr
  @expr
end

#whensObject

Returns the value of attribute whens.



252
253
254
# File 'lib/vertigo/ast_vertigo_rkgen.rb', line 252

def whens
  @whens
end

Instance Method Details

#<<(e) ⇒ Object



58
59
60
# File 'lib/vertigo/ast.rb', line 58

def << e
  @whens << e
end