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?, #hash

Instance Attribute Details

#data -> Object (readonly)

Returns the value of attribute data.



223
224
225
# File 'lib/discorb/audit_logs.rb', line 223

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:



256
257
258
# File 'lib/discorb/audit_logs.rb', line 256

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

#inspect -> Object



235
236
237
# File 'lib/discorb/audit_logs.rb', line 235

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

#keys -> Array<Symbol>

Get keys of changes.

Returns:

  • (Array<Symbol>)

    The keys of the changes.



244
245
246
# File 'lib/discorb/audit_logs.rb', line 244

def keys
  @data.keys
end