Module: Psych

Defined in:
lib/delayed/psych_ext.rb

Class Method Summary collapse

Class Method Details

.dump_dj(object) ⇒ Object



21
22
23
24
25
# File 'lib/delayed/psych_ext.rb', line 21

def self.dump_dj(object)
  visitor = Delayed::PsychExt::YAMLTree.create
  visitor << object
  visitor.tree.yaml
end

.load_dj(yaml) ⇒ Object



16
17
18
19
# File 'lib/delayed/psych_ext.rb', line 16

def self.load_dj(yaml)
  result = parse(yaml)
  result ? Delayed::PsychExt::ToRuby.create.accept(result) : result
end