Class: Ruqqus::User

Inherits:
ItemBase show all
Defined in:
lib/ruqqus/types/user.rb

Overview

Represents a Ruqqus user account.

Instance Attribute Summary collapse

Attributes inherited from ItemBase

#created, #created_utc, #id, #permalink

Instance Method Summary collapse

Methods inherited from ItemBase

#==, #banned?, from_json

Instance Attribute Details

#badgesArray<Badge> (readonly)

Returns an array of badges associated with this account.

Returns:

  • (Array<Badge>)

    an array of badges associated with this account.



# File 'lib/ruqqus/types/user.rb', line 28

#ban_reasonString? (readonly)

Returns the reason the user was banned if they were, otherwise nil.

Returns:

  • (String?)

    the reason the user was banned if they were, otherwise nil.



# File 'lib/ruqqus/types/user.rb', line 52

Returns the URL for the banner image associated with the account.

Returns:

  • (String)

    the URL for the banner image associated with the account.



# File 'lib/ruqqus/types/user.rb', line 36

#bioString (readonly)

Returns A brief statement/biography the user has associated with their account.

Returns:

  • (String)

    A brief statement/biography the user has associated with their account.



# File 'lib/ruqqus/types/user.rb', line 44

#bio_htmlString (readonly)

Returns a brief statement/biography the user has associated with their account in HTML format.

Returns:

  • (String)

    a brief statement/biography the user has associated with their account in HTML format.



# File 'lib/ruqqus/types/user.rb', line 48

#comment_countInteger (readonly)

Returns the number of comments the user has created.

Returns:

  • (Integer)

    the number of comments the user has created.



# File 'lib/ruqqus/types/user.rb', line 8

#comment_repInteger (readonly)

Returns the amount of rep the user has earned from comments.

Returns:

  • (Integer)

    the amount of rep the user has earned from comments.



# File 'lib/ruqqus/types/user.rb', line 16

#post_countInteger (readonly)

Returns the number of posts the user has created.

Returns:

  • (Integer)

    the number of posts the user has created.



# File 'lib/ruqqus/types/user.rb', line 12

#post_repInteger (readonly)

Returns the amount of rep the user has earned from posts.

Returns:

  • (Integer)

    the amount of rep the user has earned from posts.



# File 'lib/ruqqus/types/user.rb', line 20

#profile_urlString (readonly)

Returns the URL for the profile image associated with the account.

Returns:

  • (String)

    the URL for the profile image associated with the account.



# File 'lib/ruqqus/types/user.rb', line 40

#titleTitle? (readonly)

Returns the title the user has associated with their account, or nil if none is assigned.

Returns:

  • (Title?)

    the title the user has associated with their account, or nil if none is assigned.



# File 'lib/ruqqus/types/user.rb', line 32

#total_repInteger (readonly)

Returns the total amount of rep the user has earned from comments and posts.

Returns:

  • (Integer)

    the total amount of rep the user has earned from comments and posts.



# File 'lib/ruqqus/types/user.rb', line 24

Instance Method Details

#to_sString

Returns the string representation of the object.

Returns:

  • (String)

    the string representation of the object.



58
59
60
# File 'lib/ruqqus/types/user.rb', line 58

def to_s
  @data[:username] || inspect
end

#usernameString

Returns the username of the account.

Returns:

  • (String)

    the username of the account.



84
85
86
# File 'lib/ruqqus/types/user.rb', line 84

def username
  @data[:username]
end