Class: Sexpir::When
- Defined in:
- lib/sexpir/ast.rb,
lib/sexpir/ast_sexp.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#expr ⇒ Object
Returns the value of attribute expr.
Attributes inherited from Ast
Instance Method Summary collapse
Methods inherited from Ast
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
80 81 82 |
# File 'lib/sexpir/ast.rb', line 80 def body @body end |
#expr ⇒ Object
Returns the value of attribute expr.
80 81 82 |
# File 'lib/sexpir/ast.rb', line 80 def expr @expr end |
Instance Method Details
#sexp ⇒ Object
149 150 151 152 153 154 155 156 157 |
# File 'lib/sexpir/ast_sexp.rb', line 149 def sexp code=Code.new code << "(when #{expr.sexp}" code.indent=2 code << body.sexp code.indent=0 code << ")" code end |