Class: JvYAML::Object
- Inherits:
-
Object
- Object
- JvYAML::Object
- Defined in:
- lib/jvyaml.rb
Instance Attribute Summary collapse
-
#class ⇒ Object
Returns the value of attribute class.
-
#ivars ⇒ Object
Returns the value of attribute ivars.
Instance Method Summary collapse
-
#initialize(cl, iv) ⇒ Object
constructor
A new instance of Object.
- #to_jvyaml(opts = {}) ⇒ Object
Constructor Details
#initialize(cl, iv) ⇒ Object
Returns a new instance of Object.
83 84 85 |
# File 'lib/jvyaml.rb', line 83 def initialize(cl, iv) @class, @ivars = cl, iv end |
Instance Attribute Details
#class ⇒ Object
Returns the value of attribute class.
82 83 84 |
# File 'lib/jvyaml.rb', line 82 def class @class end |
#ivars ⇒ Object
Returns the value of attribute ivars.
82 83 84 |
# File 'lib/jvyaml.rb', line 82 def ivars @ivars end |
Instance Method Details
#to_jvyaml(opts = {}) ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/jvyaml.rb', line 87 def to_jvyaml( opts = {} ) JvYAML::quick_emit( object_id, opts ) do |out| out.map( "tag:ruby.yaml.org,2002:object:#{ @class }", to_jvyaml_style ) do |map| @ivars.each do |k,v| map.add( k, v ) end end end end |