class Guilds
Represents a collection of guilds.
Definitions
def each(&block)
Enumerate over each guild.
Signature
-
yields
{|guild| ...}
if a block is given.
-
parameter
guild
Guild
The guild.
-
parameter
-
returns
Enumerator
if no block is given.
Implementation
def each(&block)
return to_enum unless block_given?
self.value.each do |value|
path = "/api/v10/guilds/#{value[:id]}"
yield Guild.new(@resource.with(path: path), value: value)
end
end
def to_a
Convert the collection to an array.
Signature
-
returns
Array(Guild)
the collection as an array.
Implementation
def to_a
each.to_a
end
def empty?
Signature
-
returns
Boolean
if the collection is empty.
Implementation
def empty?
self.value.empty?
end