Class: Discorb::AuditLog::Entry::Changes

Inherits:
DiscordModel show all
Defined in:
lib/discorb/audit_logs.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

#data -> Object (readonly)

Returns the value of attribute data.



248
249
250
# File 'lib/discorb/audit_logs.rb', line 248

def data
  @data
end

Instance Method Details

#[](key) -> Discorb::AuditLog::Entry::Change?

Get a change with the given key.

Parameters:

  • key (Symbol)

    The key to get.

Returns:



287
288
289
# File 'lib/discorb/audit_logs.rb', line 287

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

#inspect -> Object

Formats the changes into a string.



266
267
268
# File 'lib/discorb/audit_logs.rb', line 266

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

#keys -> Array<Symbol>

Get keys of changes.

Returns:

  • (Array<Symbol>)

    The keys of the changes.



275
276
277
# File 'lib/discorb/audit_logs.rb', line 275

def keys
  @data.keys
end