Class: ErrbitZmqHandler::Configuration
- Inherits:
-
Object
- Object
- ErrbitZmqHandler::Configuration
- Defined in:
- lib/errbit_zmq_handler/configuration.rb
Overview
Used to set up and modify settings for the notifier.
Constant Summary collapse
- OPTIONS =
[:uri].freeze
Instance Attribute Summary collapse
-
#uri ⇒ Object
The uri to bind to (0MQ socket).
Instance Method Summary collapse
-
#[](option) ⇒ Object
Allows config options to be read like a hash.
-
#merge(hash) ⇒ Object
Returns a hash of all configurable options merged with
hash
. -
#to_hash ⇒ Object
Returns a hash of all configurable options.
Instance Attribute Details
#uri ⇒ Object
The uri to bind to (0MQ socket)
9 10 11 |
# File 'lib/errbit_zmq_handler/configuration.rb', line 9 def uri @uri end |
Instance Method Details
#[](option) ⇒ Object
Allows config options to be read like a hash
14 15 16 |
# File 'lib/errbit_zmq_handler/configuration.rb', line 14 def [](option) send(option) end |
#merge(hash) ⇒ Object
Returns a hash of all configurable options merged with hash
28 29 30 |
# File 'lib/errbit_zmq_handler/configuration.rb', line 28 def merge(hash) to_hash.merge(hash) end |
#to_hash ⇒ Object
Returns a hash of all configurable options
19 20 21 22 23 |
# File 'lib/errbit_zmq_handler/configuration.rb', line 19 def to_hash OPTIONS.inject({}) do |hash, option| hash.merge(option.to_sym => send(option)) end end |