Class: Module

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

Overview

:nodoc: all

Instance Method Summary collapse

Instance Method Details

#yaml_as(tag, sc = true) ⇒ Object



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/rbyaml.rb', line 214

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_nameObject

Transforms the subclass name into a name suitable for display in a subclassed tag.



231
232
233
# File 'lib/rbyaml.rb', line 231

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.



236
237
238
# File 'lib/rbyaml.rb', line 236

def yaml_tag_read_class( name )
  name
end