Class: FeedParser::Author

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#avatarObject

todo/check: use avatar_url ?? used by json feed -check if always a url



17
18
19
# File 'lib/feedparser/author.rb', line 17

def avatar
  @avatar
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#textObject Also known as: line

todo: add role - why? why not?

e.g. add contributor (atom)
       or managingEditor (rss) or webMaster (rss) - why? why not??


24
25
26
# File 'lib/feedparser/author.rb', line 24

def text
  @text
end

#urlObject Also known as: uri

Returns the value of attribute url.



8
9
10
# File 'lib/feedparser/author.rb', line 8

def url
  @url
end

Instance Method Details

#avatar?Boolean

Returns:

  • (Boolean)


16
# File 'lib/feedparser/author.rb', line 16

def avatar?()  @avatar.nil? == false;  end

#email?Boolean

Returns:

  • (Boolean)


13
# File 'lib/feedparser/author.rb', line 13

def email?()   @email.nil? == false;  end

#to_sObject



27
28
29
30
31
32
33
34
35
# File 'lib/feedparser/author.rb', line 27

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