Class: Mirah::AST::NodeProxy

Inherits:
Object
  • Object
show all
Includes:
Java::DubyLangCompiler::Node
Defined in:
lib/mirah/ast.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._load(str) ⇒ Object



417
418
419
420
421
422
423
424
425
# File 'lib/mirah/ast.rb', line 417

def self._load(str)
  value = Marshal.load(str)
  if value.respond_to?(:proxy=)
    proxy = NodeProxy.new(value)
    proxy.proxy = proxy
  else
    value
  end
end

Instance Method Details

#__inline__(node) ⇒ Object



396
397
398
399
# File 'lib/mirah/ast.rb', line 396

def __inline__(node)
  node.parent = parent
  __setobj__(node)
end

#_dump(depth) ⇒ Object



413
414
415
# File 'lib/mirah/ast.rb', line 413

def _dump(depth)
  Marshal.dump(__getobj__)
end

#dupObject



401
402
403
404
405
406
407
408
409
410
411
# File 'lib/mirah/ast.rb', line 401

def dup
  value = __getobj__.dup
  if value.respond_to?(:proxy=)
    new = super
    new.__setobj__(value)
    new.proxy = new
    new
  else
    value
  end
end