Class: Ruqqus::Guild

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

Overview

Represents a Ruqqus guild.

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

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

Returns:

  • (String)

    the URL for the banner image associated with the guild.



# File 'lib/ruqqus/types/guild.rb', line 39

#colorString (readonly)

Returns the accent color used for the guild, in HTML format.

Returns:

  • (String)

    the accent color used for the guild, in HTML format.



# File 'lib/ruqqus/types/guild.rb', line 27

#descriptionString (readonly)

Returns the description of the guild.

Returns:

  • (String)

    the description of the guild.



# File 'lib/ruqqus/types/guild.rb', line 31

#description_htmlString (readonly)

Returns the description of the guild in HTML format.

Returns:

  • (String)

    the description of the guild in HTML format.



# File 'lib/ruqqus/types/guild.rb', line 35

#fullnameString (readonly)

Returns the full ID of the guild.

Returns:

  • (String)

    the full ID of the guild.



# File 'lib/ruqqus/types/guild.rb', line 15

#guildmaster_countInteger (readonly)

Returns the number of guild masters who moderate this guild.

Returns:

  • (Integer)

    the number of guild masters who moderate this guild.



# File 'lib/ruqqus/types/guild.rb', line 19

#guildmastersArray<User> (readonly)

Returns an array of User instances of the moderators for this guild.

Returns:

  • (Array<User>)

    an array of User instances of the moderators for this guild.



# File 'lib/ruqqus/types/guild.rb', line 43

#member_countInteger (readonly)

Returns the number of members subscribed to the guild.

Returns:

  • (Integer)

    the number of members subscribed to the guild.



# File 'lib/ruqqus/types/guild.rb', line 11

#nameString (readonly)

Returns the name of the guild.

Returns:

  • (String)

    the name of the guild.



# File 'lib/ruqqus/types/guild.rb', line 7

#profile_urlString (readonly)

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

Returns:

  • (String)

    the URL for the profile image associated with the guild.



# File 'lib/ruqqus/types/guild.rb', line 23

Instance Method Details

#nsfw?Boolean

Returns true if the guild contains adult content and flagged as NSFW, otherwise false.

Returns:

  • (Boolean)

    true if the guild contains adult content and flagged as NSFW, otherwise false.



49
50
51
# File 'lib/ruqqus/types/guild.rb', line 49

def nsfw?
  @data[:over_18]
end

#private?Boolean

Returns true if guild is private and required membership to view content, otherwise false.

Returns:

  • (Boolean)

    true if guild is private and required membership to view content, otherwise false.



55
56
57
# File 'lib/ruqqus/types/guild.rb', line 55

def private?
  !!@data[:is_private]
end

#restricted?Boolean

Returns true if posting is restricted byy guild masters, otherwise false.

Returns:

  • (Boolean)

    true if posting is restricted byy guild masters, otherwise false.



61
62
63
# File 'lib/ruqqus/types/guild.rb', line 61

def restricted?
  !!@data[:is_restricted]
end

#to_sString

Returns the string representation of the object.

Returns:

  • (String)

    the string representation of the object.



67
68
69
# File 'lib/ruqqus/types/guild.rb', line 67

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