Skip to main content

Class

A library for getting and parsing the Roblox API dump.

Constructor

Get a class through the Gopher library:

local class = Gopher:getClass("Instance")

Functions

Return TypeSignatureDescription
DictionarygetAllMembers(bool recursive)Get a dictionary of all members of the class.
DictionarygetAllMembersOfType(MemberType memberType, bool recursive)Get a dictionary of all the class's members of a particular member type.
DictionarygetAllMembersByTag(string tag, bool recursive)Get a dictionary of all the class's members that have a particular tag.
DictionarygetMember(string memberName)Get the info of the provided member.

getAllMembers

Get a dictionary of all members of the class. If recursive is true, this list will include inherited members.

local class = Gopher:getClass("BasePart")

local members = class:getAllMembers()
local allMembers = class:getAllMembers(true)

print(members.Name) -- nil
print(allMembers.Name) -- dictionary

Parameters

TypeNameDefaultDescription
boolrecursivefalseIf true, the provided dictionary will include inherited members.

getAllMembersOfType

Get a dictionary of all the class's members of a particular member type. If recursive is true, this list will include inherited members.

local class = Gopher:getClass("BasePart")

local members = class:getAllMembersOfType(Gopher.MemberType.Property, true)

print(members.Name) -- dictionary
print(members.Touched) -- nil because Touched is not a property

Parameters

TypeNameDefaultDescription
MemberTypememberTypeThe type of members to return.
boolrecursivefalseIf true, the provided dictionary will include inherited members.

getAllMembersByTag

Get a dictionary of all the class's members that have a particular tag. If recursive is true, this list will include inherited members.

local class = Gopher:getClass("BasePart")

local members = class:getAllMembersByTag("Deprecated", true)

print(members.Name) -- nil because Name is not deprecated
print(members.name) -- dictionary

Parameters

TypeNameDefaultDescription
stringtagThe tag to search members for.
boolrecursivefalseIf true, the provided dictionary will include inherited members.

getMember

Get the info of the provided member. If recursive is true, this function will work for inherited members.

local class = Gopher:getClass("BasePart")

print(class:getMember("Name", true)) -- dictionary
print(class:getMember("Name")) -- nil because Name is inherited

Parameters

TypeNameDefaultDescription
stringnameThe name of the member to return.
boolrecursivefalseIf true, this function will work for inherited members.