Class: Module

Inherits:
Object show all
Defined in:
lib/rbyaml/tag.rb

Overview

:nodoc: all

Instance Method Summary collapse

Instance Method Details

#yaml_as(tag, sc = true) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rbyaml/tag.rb', line 47

def yaml_as( tag, sc = true )
  class_eval "  attr_writer :taguri\n  def taguri\n    return @taguri if defined?(@taguri) and @taguri\n    tag = \#{ tag.dump }\n      if self.class.yaml_tag_subclasses? and self.class != RbYAML::tagged_classes[tag]\n        tag = \"\\\#{ tag }:\\\#{ self.class.yaml_tag_class_name }\"\n      end\n    tag\n  end\n  def self.yaml_tag_subclasses?; \#{ sc ? 'true' : 'false' }; end\n  end;\n  RbYAML::tag_class tag, self\nend\n", __FILE__, __LINE__+1

#yaml_tag_class_nameObject

in a subclassed tag.



64
65
66
# File 'lib/rbyaml/tag.rb', line 64

def yaml_tag_class_name
  self.name
end

#yaml_tag_read_class(name) ⇒ Object

Transforms the subclass name found in the tag into a Ruby constant name.



69
70
71
# File 'lib/rbyaml/tag.rb', line 69

def yaml_tag_read_class( name )
  name
end