Module: YAML

Defined in:
lib/rcl/ext/yaml_helper.rb

Class Method Summary collapse

Class Method Details

.call_post_deserialize(obj, object_map = ::Set.new) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rcl/ext/yaml_helper.rb', line 78

def YAML.call_post_deserialize obj, object_map = ::Set.new
  if !object_map.include?(obj.object_id)
    object_map.add(obj.object_id)
   
    obj.instance_variables.each do |v|
      call_post_deserialize obj.instance_variable_get(v), object_map
    end

    obj.post_deserialize if obj.respond_to?('post_deserialize')
  end
end

.load(io) ⇒ Object



90
91
92
93
94
# File 'lib/rcl/ext/yaml_helper.rb', line 90

def YAML.load( io )
  yp = parser.load( io )
  call_post_deserialize yp
  yp
end