Class: Disqus::Author

Inherits:
BaseAuthor show all
Defined in:
lib/disqus/author.rb

Instance Attribute Summary collapse

Attributes inherited from BaseAuthor

#email_hash, #url

Instance Method Summary collapse

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_nameObject (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_avatarObject (readonly)

Returns the value of attribute has_avatar


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

def has_avatar
  @has_avatar
end

#idObject (readonly)

Returns the value of attribute id


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

def id
  @id
end

#usernameObject (readonly)

Returns the value of attribute username


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

def username
  @username
end

Instance Method Details

#nameObject

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