Class: ActionThrottler::Config
- Inherits:
-
Object
- Object
- ActionThrottler::Config
- Defined in:
- lib/action_throttler/config.rb
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #method_missing(key, value) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
3 4 5 |
# File 'lib/action_throttler/config.rb', line 3 def initialize @config ||= {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, value) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/action_throttler/config.rb', line 11 def method_missing(key, value) # converts `key=()` methods to `key()` key = key.to_s.sub(/=$/, "").to_sym @config[key] = value end |
Instance Method Details
#to_hash ⇒ Object
7 8 9 |
# File 'lib/action_throttler/config.rb', line 7 def to_hash @config end |