Class: Chelsy::Case

Inherits:
Labeled show all
Defined in:
lib/chelsy/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Labeled

#label, #stmt

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(expr, stmt, **rest) ⇒ Case

Returns a new instance of Case.



1004
1005
1006
1007
# File 'lib/chelsy/ast.rb', line 1004

def initialize(expr, stmt, **rest)
  @expr = Syntax::Expr.ensure(expr)
  super :case, stmt, **rest
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



1002
1003
1004
# File 'lib/chelsy/ast.rb', line 1002

def expr
  @expr
end