Class: FeedParser::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/feedparser/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject Also known as: title

Returns the value of attribute name.



7
8
9
# File 'lib/feedparser/generator.rb', line 7

def name
  @name
end

#textObject Also known as: line

note: holds “unparsed” text (content) line form rss:generator



20
21
22
# File 'lib/feedparser/generator.rb', line 20

def text
  @text
end

#urlObject Also known as: uri

Returns the value of attribute url.



14
15
16
# File 'lib/feedparser/generator.rb', line 14

def url
  @url
end

#versionObject

Returns the value of attribute version.



12
13
14
# File 'lib/feedparser/generator.rb', line 12

def version
  @version
end

Instance Method Details

#to_sObject



24
25
26
27
28
29
30
31
32
# File 'lib/feedparser/generator.rb', line 24

def to_s
  ## note: to_s  - allows to use just generator in templates
  ##    will by default return name if present or as fallback "unparsed" text line
   if @name    ## not blank
     @name
   else
     @text
   end
end