Class: CrossPost::Config::FifoSubConfig
- Defined in:
- lib/cross-post/config.rb
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize(size = 100) ⇒ FifoSubConfig
constructor
A new instance of FifoSubConfig.
Methods inherited from SubConfig
Constructor Details
#initialize(size = 100) ⇒ FifoSubConfig
Returns a new instance of FifoSubConfig.
60 61 62 63 64 |
# File 'lib/cross-post/config.rb', line 60 def initialize(size = 100) @size = size @keys = [] super({}) end |
Instance Method Details
#[]=(key, value) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cross-post/config.rb', line 66 def []=(key, value) @keys.delete key value = super key, value @keys << key while @keys.size > @size key = @keys.delete_at 0 @config.delete key end value end |