Class: Harmoniser::Configuration
- Inherits:
-
Object
- Object
- Harmoniser::Configuration
- Extended by:
- Forwardable
- Defined in:
- lib/harmoniser/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #connection_opts ⇒ Object
- #connection_opts=(opts) ⇒ Object
- #define_topology {|@topology| ... } ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #options_with ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 |
# File 'lib/harmoniser/configuration.rb', line 13 def initialize @logger = Harmoniser.logger @options = Options.new(**) set_logger_severity @topology = Topology.new end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/harmoniser/configuration.rb', line 10 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/harmoniser/configuration.rb', line 10 def @options end |
Instance Method Details
#connection_opts ⇒ Object
20 21 22 |
# File 'lib/harmoniser/configuration.rb', line 20 def connection_opts @connection_opts ||= Connection::DEFAULT_CONNECTION_OPTS end |
#connection_opts=(opts) ⇒ Object
24 25 26 27 28 |
# File 'lib/harmoniser/configuration.rb', line 24 def connection_opts=(opts) raise TypeError, "opts must be a Hash object" unless opts.is_a?(Hash) @connection_opts = connection_opts.merge(opts) end |
#define_topology {|@topology| ... } ⇒ Object
30 31 32 33 34 |
# File 'lib/harmoniser/configuration.rb', line 30 def define_topology raise LocalJumpError, "A block is required for this method" unless block_given? yield(@topology) end |
#options_with ⇒ Object
36 37 38 39 |
# File 'lib/harmoniser/configuration.rb', line 36 def (**) @options = .with(**) set_logger_severity end |