Class: OnyxCord::Configuration::CacheSizes

Inherits:
Object
  • Object
show all
Defined in:
lib/onyxcord/core/configuration.rb

Overview

Stores maximum limits for each LRU cache entity type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCacheSizes

Returns a new instance of CacheSizes.



50
51
52
53
54
55
56
57
58
# File 'lib/onyxcord/core/configuration.rb', line 50

def initialize
  @servers = 1000
  @channels = 10_000
  @users = 50_000
  @members = 100_000
  @pm_channels = 1000
  @thread_members = 5000
  @server_previews = 100
end

Instance Attribute Details

#channelsObject

Returns the value of attribute channels.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def channels
  @channels
end

#membersObject

Returns the value of attribute members.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def members
  @members
end

#pm_channelsObject

Returns the value of attribute pm_channels.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def pm_channels
  @pm_channels
end

#server_previewsObject

Returns the value of attribute server_previews.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def server_previews
  @server_previews
end

#serversObject

Returns the value of attribute servers.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def servers
  @servers
end

#thread_membersObject

Returns the value of attribute thread_members.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def thread_members
  @thread_members
end

#usersObject

Returns the value of attribute users.



48
49
50
# File 'lib/onyxcord/core/configuration.rb', line 48

def users
  @users
end

Instance Method Details

#[](key) ⇒ Object



60
61
62
# File 'lib/onyxcord/core/configuration.rb', line 60

def [](key)
  send(key)
end

#[]=(key, value) ⇒ Object



64
65
66
# File 'lib/onyxcord/core/configuration.rb', line 64

def []=(key, value)
  send("#{key}=", value)
end

#dupObject



80
81
82
83
84
# File 'lib/onyxcord/core/configuration.rb', line 80

def dup
  copy = self.class.new
  to_h.each { |k, v| copy[k] = v }
  copy
end

#to_hObject



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/onyxcord/core/configuration.rb', line 68

def to_h
  {
    servers: @servers,
    channels: @channels,
    users: @users,
    members: @members,
    pm_channels: @pm_channels,
    thread_members: @thread_members,
    server_previews: @server_previews
  }
end