Class: Rublox::FullGroup

Inherits:
Object
  • Object
show all
Includes:
Group
Defined in:
lib/rublox/models/full_group.rb

Overview

Note:

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

Instance Method Summary collapse

Methods included from Group

#member_by_id, #member_by_user, #roles

Constructor Details

#initialize(data, client) ⇒ FullGroup

Returns a new instance of FullGroup.

Parameters:



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

#descriptionString (readonly)

Returns the group’s description.

Returns:

  • (String)

    the group’s description



25
26
27
# File 'lib/rublox/models/full_group.rb', line 25

def description
  @description
end

#idInteger (readonly)

Returns the group’s ID.

Returns:

  • (Integer)

    the group’s ID



19
20
21
# File 'lib/rublox/models/full_group.rb', line 19

def id
  @id
end

#lockedtrue, false (readonly)

Returns is the group locked?.

Returns:

  • (true, false)

    is the group locked?



39
40
41
# File 'lib/rublox/models/full_group.rb', line 39

def locked
  @locked
end

#member_countInteger (readonly)

Returns the count of how many members the group has.

Returns:

  • (Integer)

    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

#nameString (readonly)

Returns the group’s name.

Returns:

  • (String)

    the group’s name



22
23
24
# File 'lib/rublox/models/full_group.rb', line 22

def name
  @name
end

#ownerLimitedUser? (readonly)

Returns the group’s owner, can be nil if the group has no owner.

Returns:

  • (LimitedUser, nil)

    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

#privatetrue, false (readonly)

Returns is the group private/invite only?.

Returns:

  • (true, false)

    is the group private/invite only?



42
43
44
# File 'lib/rublox/models/full_group.rb', line 42

def private
  @private
end

#shoutGroupShout? (readonly)

Returns the group’s shout, can be nil if the group has no shout.

Returns:

  • (GroupShout, nil)

    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