Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/rbyaml/util.rb,
lib/rbyaml/rubytypes.rb
Instance Method Summary collapse
- #__is_a ⇒ Object
- #__is_int ⇒ Object
- #__is_str ⇒ Object
- #__is_sym ⇒ Object
-
#is_complex_yaml? ⇒ Boolean
yaml_as “tag:ruby.yaml.org,2002:object”.
- #taguri ⇒ Object
- #to_yaml(opts = {}) ⇒ Object
- #to_yaml_node(repre) ⇒ Object
- #to_yaml_properties ⇒ Object
- #to_yaml_style ⇒ Object
Instance Method Details
#__is_a ⇒ Object
4 |
# File 'lib/rbyaml/util.rb', line 4 def __is_a; false end |
#__is_int ⇒ Object
5 |
# File 'lib/rbyaml/util.rb', line 5 def __is_int; false end |
#__is_str ⇒ Object
2 |
# File 'lib/rbyaml/util.rb', line 2 def __is_str; false end |
#__is_sym ⇒ Object
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”
11 |
# File 'lib/rbyaml/rubytypes.rb', line 11 def is_complex_yaml?; true; end |
#taguri ⇒ Object
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_properties ⇒ Object
13 |
# File 'lib/rbyaml/rubytypes.rb', line 13 def to_yaml_properties; instance_variables.sort; end |
#to_yaml_style ⇒ Object
12 |
# File 'lib/rbyaml/rubytypes.rb', line 12 def to_yaml_style; end |