Class: Module
Overview
:nodoc: all
Instance Method Summary collapse
- #yaml_as(tag, sc = true) ⇒ Object
-
#yaml_tag_class_name ⇒ Object
in a subclassed tag.
-
#yaml_tag_read_class(name) ⇒ Object
Transforms the subclass name found in the tag into a Ruby constant name.
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 <<-"end;", __FILE__, __LINE__+1 attr_writer :taguri def taguri return @taguri if defined?(@taguri) and @taguri tag = #{ tag.dump } if self.class.yaml_tag_subclasses? and self.class != RbYAML::tagged_classes[tag] tag = "\#{ tag }:\#{ self.class.yaml_tag_class_name }" end tag end def self.yaml_tag_subclasses?; #{ sc ? 'true' : 'false' }; end end; RbYAML::tag_class tag, self end |
#yaml_tag_class_name ⇒ Object
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 |