Class: RubyCord::Guild::AuditLog::Entry::Changes

Inherits:
DiscordModel
  • Object
show all
Defined in:
lib/rubycord/guild/audit_log/entry.rb

Overview

Represents the changes in an audit log entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



218
219
220
# File 'lib/rubycord/guild/audit_log/entry.rb', line 218

def data
  @data
end

Instance Method Details

#[](key) ⇒ RubyCord::Guild::AuditLog::Entry::Change?

Get a change with the given key.

Parameters:

  • key (Symbol)

    The key to get.

Returns:



255
256
257
# File 'lib/rubycord/guild/audit_log/entry.rb', line 255

def [](key)
  @data[key.to_sym]
end

#inspectString

Returns Formats the changes into a string.

Returns:

  • (String)

    Formats the changes into a string.



234
235
236
# File 'lib/rubycord/guild/audit_log/entry.rb', line 234

def inspect
  "#<#{self.class} #{@data.length} changes>"
end

#keysArray<Symbol>

Get keys of changes.

Returns:

  • (Array<Symbol>)

    The keys of the changes.



243
244
245
# File 'lib/rubycord/guild/audit_log/entry.rb', line 243

def keys
  @data.keys
end