Class: Duby::AST::JRubyAst::IfNode

Inherits:
Object
  • Object
show all
Defined in:
lib/duby/transform.rb

Instance Method Summary collapse

Instance Method Details

#transform(transformer, parent) ⇒ Object



554
555
556
557
558
559
560
561
562
# File 'lib/duby/transform.rb', line 554

def transform(transformer, parent)
  If.new(parent, position) do |iff|
    [
      Condition.new(iff, condition.position) {|cond| [transformer.transform(condition, cond)]},
      then_body ? transformer.transform(then_body, iff) : nil,
      else_body ? transformer.transform(else_body, iff) : nil
    ]
  end
end