Class: Object

Inherits:
BasicObject
Defined in:
lib/rbyaml/util.rb,
lib/rbyaml/rubytypes.rb

Instance Method Summary collapse

Instance Method Details

#__is_aObject



4
# File 'lib/rbyaml/util.rb', line 4

def __is_a; false end

#__is_intObject



5
# File 'lib/rbyaml/util.rb', line 5

def __is_int; false end

#__is_strObject



2
# File 'lib/rbyaml/util.rb', line 2

def __is_str; false end

#__is_symObject



3
# File 'lib/rbyaml/util.rb', line 3

def __is_sym; false end

#is_complex_yaml?Boolean

yaml_as “tag:ruby.yaml.org,2002:object”

Returns:

  • (Boolean)


11
# File 'lib/rbyaml/rubytypes.rb', line 11

def is_complex_yaml?; true; end

#taguriObject



17
18
19
# File 'lib/rbyaml/rubytypes.rb', line 17

def taguri
  "!ruby/object:#{self.class.name}"
end

#to_yaml(opts = {}) ⇒ Object



14
15
16
# File 'lib/rbyaml/rubytypes.rb', line 14

def to_yaml( opts = {} )
  RbYAML::dump(self,nil,opts)
end

#to_yaml_node(repre) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/rbyaml/rubytypes.rb', line 20

def to_yaml_node( repre )
  RbYAML::quick_emit_node( object_id, repre ) do |out|
    mep = {}
    to_yaml_properties.each do |m|
      mep[m[1..-1]] = instance_variable_get(m)
    end      
    out.map(taguri,mep,to_yaml_style)
  end
end

#to_yaml_propertiesObject



13
# File 'lib/rbyaml/rubytypes.rb', line 13

def to_yaml_properties; instance_variables.sort; end

#to_yaml_styleObject



12
# File 'lib/rbyaml/rubytypes.rb', line 12

def to_yaml_style; end