Class: Atom::AttrEl
- Defined in:
- lib/atom/element.rb,
lib/atom/yaml.rb
Overview
this facilitates YAML output
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from Element
#[], #[]=, attrb, attrs, define_accessor, element, elements, inherited, #initialize, #local_name, required, #taguri, #to_element, #to_s, #to_xml, #to_yaml_properties
Constructor Details
This class inherits a constructor from Atom::Element
Instance Method Details
#to_yaml(opts = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/atom/yaml.rb', line 32 def to_yaml( opts = {} ) YAML::quick_emit( object_id, opts ) do |out| out.map( nil, to_yaml_style ) do |map| self.class.attrs.each do |n,r| map.add( n.to_s, self[n.to_s] ) if self[n.to_s] end end end end |