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



708
709
710
711
712
713
714
715
716
# File 'lib/duby/transform.rb', line 708

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