Class: OnyxCord::Configuration::CacheSizes
- Inherits:
-
Object
- Object
- OnyxCord::Configuration::CacheSizes
- Defined in:
- lib/onyxcord/core/configuration.rb
Overview
Stores maximum limits for each LRU cache entity type.
Instance Attribute Summary collapse
-
#channels ⇒ Object
Returns the value of attribute channels.
-
#members ⇒ Object
Returns the value of attribute members.
-
#pm_channels ⇒ Object
Returns the value of attribute pm_channels.
-
#server_previews ⇒ Object
Returns the value of attribute server_previews.
-
#servers ⇒ Object
Returns the value of attribute servers.
-
#thread_members ⇒ Object
Returns the value of attribute thread_members.
-
#users ⇒ Object
Returns the value of attribute users.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #dup ⇒ Object
-
#initialize ⇒ CacheSizes
constructor
A new instance of CacheSizes.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ CacheSizes
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
#channels ⇒ Object
Returns the value of attribute channels.
48 49 50 |
# File 'lib/onyxcord/core/configuration.rb', line 48 def channels @channels end |
#members ⇒ Object
Returns the value of attribute members.
48 49 50 |
# File 'lib/onyxcord/core/configuration.rb', line 48 def members @members end |
#pm_channels ⇒ Object
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_previews ⇒ Object
Returns the value of attribute server_previews.
48 49 50 |
# File 'lib/onyxcord/core/configuration.rb', line 48 def server_previews @server_previews end |
#servers ⇒ Object
Returns the value of attribute servers.
48 49 50 |
# File 'lib/onyxcord/core/configuration.rb', line 48 def servers @servers end |
#thread_members ⇒ Object
Returns the value of attribute thread_members.
48 49 50 |
# File 'lib/onyxcord/core/configuration.rb', line 48 def thread_members @thread_members end |
#users ⇒ Object
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 |
#dup ⇒ Object
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_h ⇒ Object
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 |