Class: Disqus::Author
- Inherits:
-
BaseAuthor
- Object
- BaseAuthor
- Disqus::Author
- Defined in:
- lib/disqus/author.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#has_avatar ⇒ Object
readonly
Returns the value of attribute has_avatar.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from BaseAuthor
Instance Method Summary collapse
-
#initialize(id, username, display_name, url, email_hash, has_avatar) ⇒ Author
constructor
A new instance of Author.
-
#name ⇒ Object
Returns the user’s
display_name
orusername
ifdisplay_name
is blank.
Constructor Details
#initialize(id, username, display_name, url, email_hash, has_avatar) ⇒ Author
Returns a new instance of Author.
9 10 11 |
# File 'lib/disqus/author.rb', line 9 def initialize(id, username, display_name, url, email_hash, has_avatar) @id, @username, @display_name, @url, @email_hash, @has_avatar = id, username, display_name, url, email_hash, has_avatar end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
8 9 10 |
# File 'lib/disqus/author.rb', line 8 def display_name @display_name end |
#has_avatar ⇒ Object (readonly)
Returns the value of attribute has_avatar.
8 9 10 |
# File 'lib/disqus/author.rb', line 8 def has_avatar @has_avatar end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/disqus/author.rb', line 8 def id @id end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
8 9 10 |
# File 'lib/disqus/author.rb', line 8 def username @username end |
Instance Method Details
#name ⇒ Object
Returns the user’s display_name
or username
if display_name
is blank.
14 15 16 |
# File 'lib/disqus/author.rb', line 14 def name @display_name.blank? ? @username : @display_name end |