Class: Module

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yaml_new(klass, tag, val) ⇒ Object



4
5
6
# File 'lib/delayed/syck_ext.rb', line 4

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

Instance Method Details

#to_yaml(options = {}) ⇒ Object



8
9
10
11
12
# File 'lib/delayed/syck_ext.rb', line 8

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

#yaml_tag_read_class(name) ⇒ Object



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

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