Class: Opml
- Inherits:
-
Object
- Object
- Opml
- Defined in:
- lib/opml.rb
Defined Under Namespace
Modules: VERSION Classes: Outline
Instance Attribute Summary collapse
-
#outlines ⇒ Object
readonly
Returns the value of attribute outlines.
Instance Method Summary collapse
- #flatten ⇒ Object
-
#initialize(xml) ⇒ Opml
constructor
A new instance of Opml.
Constructor Details
#initialize(xml) ⇒ Opml
Returns a new instance of Opml.
50 51 52 53 54 55 56 57 |
# File 'lib/opml.rb', line 50 def initialize(xml) @doc = REXML::Document.new(xml) parse_head_elements :title, :owner_name, :owner_email parse_head_elements :date_created, :date_modified, :with => Proc.new { |e| Time.parse(e) } @outlines = document_body ? initialize_outlines_from_document_body : [] end |
Instance Attribute Details
#outlines ⇒ Object (readonly)
Returns the value of attribute outlines.
48 49 50 |
# File 'lib/opml.rb', line 48 def outlines @outlines end |
Instance Method Details
#flatten ⇒ Object
59 60 61 |
# File 'lib/opml.rb', line 59 def flatten @flatten ||= @outlines.map(&:flatten).flatten end |