Class: Hanuman::Stage

Inherits:
Object
  • Object
show all
Extended by:
StageClassMethods
Includes:
Gorillib::Model, StageInstanceMethods
Defined in:
lib/hanuman/stage.rb

Direct Known Subclasses

Graph, Wukong::Processor

Instance Attribute Summary

Attributes included from StageInstanceMethods

#graph

Instance Method Summary collapse

Methods included from StageClassMethods

builder, label, register, set_builder

Methods included from StageInstanceMethods

#add_link, #linkable_name, #root

Instance Method Details

#cloneObject



50
51
52
53
54
# File 'lib/hanuman/stage.rb', line 50

def clone
  cloned_attrs = Hash[ attributes.map{ |key, val| dup_key = key.dup rescue key ; dup_val = val.dup rescue val ; [ dup_key, dup_val ] } ]
  cloned_links = links.map{ |link| link.dup }
  self.class.receive(cloned_attrs.merge(links: cloned_links))
end