Class: Duby::AST::JRubyAst::InstAsgnNode

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

Instance Method Summary collapse

Instance Method Details

#transform(transformer, parent) ⇒ Object



851
852
853
854
855
856
857
858
859
860
861
# File 'lib/duby/transform.rb', line 851

def transform(transformer, parent)
  case value_node
  when SymbolNode, ConstNode
    FieldDeclaration.new(parent, position,
                         name, transformer.annotations) do |field_decl|
      [value_node.type_reference(field_decl)]
    end
  else
    FieldAssignment.new(parent, position, name, transformer.annotations) {|field| [transformer.transform(value_node, field)]}
  end
end