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

+ (Object) yaml_new(klass, tag, val)



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

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

Instance Method Details

- (Object) to_yaml(opts = {})



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

- (Object) yaml_tag_read_class(name)



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