Class: Suj::Pusher::Configuration
- Inherits:
-
Struct
- Object
- Struct
- Suj::Pusher::Configuration
- Defined in:
- lib/suj/pusher/configuration.rb
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_defaults ⇒ Object
- #update(other) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 |
# File 'lib/suj/pusher/configuration.rb', line 24 def initialize super set_defaults end |
Instance Method Details
#set_defaults ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/suj/pusher/configuration.rb', line 36 def set_defaults self.redis_host = "localhost" self.redis_port = 6379 self.redis_db = 0 self.redis_namespace = "pusher" self.logger = ::Logger.new(STDOUT) end |
#update(other) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/suj/pusher/configuration.rb', line 29 def update(other) CONFIG_ATTRS.each do |attr| other_value = other.send(attr) send("#{attr}=", other_value) unless other_value.nil? end end |