Class: Rublox::FullGroup
- Inherits:
-
Object
- Object
- Rublox::FullGroup
- Includes:
- Group
- Defined in:
- lib/rublox/models/full_group.rb
Overview
This class is handled internally by the public interface such as Client#group_from_id. You should not be creating it yourself.
The FullGroup class corresponds to a full group response you can get via groups.roblox.com/v1/groups/groupId. You can use it to get information about groups.
See Group for methods you can call on groups!
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The group’s description.
-
#id ⇒ Integer
readonly
The group’s ID.
-
#locked ⇒ true, false
readonly
Is the group locked?.
-
#member_count ⇒ Integer
readonly
The count of how many members the group has.
-
#name ⇒ String
readonly
The group’s name.
-
#owner ⇒ LimitedUser?
readonly
The group’s owner, can be nil if the group has no owner.
-
#private ⇒ true, false
readonly
Is the group private/invite only?.
-
#shout ⇒ GroupShout?
readonly
The group’s shout, can be nil if the group has no shout.
Instance Method Summary collapse
-
#initialize(data, client) ⇒ FullGroup
constructor
A new instance of FullGroup.
Methods included from Group
#member_by_id, #member_by_user, #roles
Constructor Details
#initialize(data, client) ⇒ FullGroup
Returns a new instance of FullGroup.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rublox/models/full_group.rb', line 46 def initialize(data, client) @id = data["id"] @name = data["name"] @description = data["description"] @owner = LimitedUser.new(data["owner"], client) if data["owner"] @shout = GroupShout.new(data["shout"], client, @id) if data["shout"] @member_count = data["memberCount"] # isLocked is only returned if the group is locked, else it is just null (awesome) @locked = !data["isLocked"].nil? @private = data["publicEntryAllowed"] @client = client end |
Instance Attribute Details
#description ⇒ String (readonly)
Returns the group’s description.
25 26 27 |
# File 'lib/rublox/models/full_group.rb', line 25 def description @description end |
#id ⇒ Integer (readonly)
Returns the group’s ID.
19 20 21 |
# File 'lib/rublox/models/full_group.rb', line 19 def id @id end |
#locked ⇒ true, false (readonly)
Returns is the group locked?.
39 40 41 |
# File 'lib/rublox/models/full_group.rb', line 39 def locked @locked end |
#member_count ⇒ Integer (readonly)
Returns the count of how many members the group has.
36 37 38 |
# File 'lib/rublox/models/full_group.rb', line 36 def member_count @member_count end |
#name ⇒ String (readonly)
Returns the group’s name.
22 23 24 |
# File 'lib/rublox/models/full_group.rb', line 22 def name @name end |
#owner ⇒ LimitedUser? (readonly)
Returns the group’s owner, can be nil if the group has no owner.
29 30 31 |
# File 'lib/rublox/models/full_group.rb', line 29 def owner @owner end |
#private ⇒ true, false (readonly)
Returns is the group private/invite only?.
42 43 44 |
# File 'lib/rublox/models/full_group.rb', line 42 def private @private end |
#shout ⇒ GroupShout? (readonly)
Returns the group’s shout, can be nil if the group has no shout.
33 34 35 |
# File 'lib/rublox/models/full_group.rb', line 33 def shout @shout end |