Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed/yaml_ext.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yaml_new(klass, tag, val) ⇒ Object



10
11
12
# File 'lib/delayed/yaml_ext.rb', line 10

def self.yaml_new(klass, tag, val)
  val.constantize
end

Instance Method Details

#to_yaml(opts = {}) ⇒ Object



14
15
16
17
18
# File 'lib/delayed/yaml_ext.rb', line 14

def to_yaml( opts = {} )
  YAML::quick_emit( nil, opts ) { |out|
    out.scalar(taguri, self.name, :plain)
  }
end

#yaml_tag_read_class(name) ⇒ Object



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

def yaml_tag_read_class(name)
  # Constantize the object so that ActiveSupport can attempt
  # its auto loading magic. Will raise LoadError if not successful.
  name.constantize
  name
end