class OPML::Outline

Private Class Methods

load( xml )
Alias for: parse
load_file( path )
Alias for: read
new( h ) click to toggle source
# File lib/opmlparser.rb, line 128
def initialize( h )
 @h = h
end
parse( xml ) click to toggle source
# File lib/opmlparser.rb, line 75
def self.parse( xml )
  Parser.new( xml ).parse
end
Also aliased as: load
read( path ) click to toggle source
# File lib/opmlparser.rb, line 78
def self.read( path )
  xml = File.open( path, 'r:utf-8' ) { |f| f.read }
  parse( xml )
end
Also aliased as: load_file

Private Instance Methods

[](index) click to toggle source
# File lib/opmlparser.rb, line 132
def [](index)
  if index.is_a?(Integer)
    h = @h['outline'][index]
    h = Outline.new( h )  if h.is_a?(Hash)  ## allow "on-demand" use/wrapping too - why? why not?
    h
  else  ## assume index is a text key
    @h[ index ]
  end
end
category() click to toggle source
# File lib/opmlparser.rb, line 161
def category()     @h['category']; end
created() click to toggle source
# File lib/opmlparser.rb, line 158
def created()      @h['created']; end
description() click to toggle source
# File lib/opmlparser.rb, line 162
def description()  @h['description']; end
each( &blk ) click to toggle source
# File lib/opmlparser.rb, line 147
def each( &blk ) @h['outline'].each( &blk ); end
htmlUrl() click to toggle source
# File lib/opmlparser.rb, line 155
def htmlUrl()      @h['htmlUrl']; end
Also aliased as: html_url
html_url()
Alias for: htmlUrl
language() click to toggle source
# File lib/opmlparser.rb, line 163
def language()     @h['language']; end
length()
Alias for: size
meta() click to toggle source
# File lib/opmlparser.rb, line 166
def meta()  @h['meta']; end
size() click to toggle source

array delegates for outline children

todo/fix: check if outline can be nil? !!!!
# File lib/opmlparser.rb, line 144
def size() @h['outline'].size; end
Also aliased as: length
text() click to toggle source
# File lib/opmlparser.rb, line 150
def text()         @h['text'];   end
title() click to toggle source
# File lib/opmlparser.rb, line 159
def title()        @h['title']; end
type() click to toggle source
# File lib/opmlparser.rb, line 160
def type()         @h['type']; end
url() click to toggle source
# File lib/opmlparser.rb, line 154
def url()          @h['url']; end
version() click to toggle source
# File lib/opmlparser.rb, line 164
def version()      @h['version']; end
xmlUrl() click to toggle source
# File lib/opmlparser.rb, line 151
def xmlUrl()       @h['xmlUrl']; end
Also aliased as: xml_url
xml_url()
Alias for: xmlUrl