Class: Linr::Config
- Inherits:
-
Object
- Object
- Linr::Config
- Defined in:
- lib/linr/config.rb
Overview
Holds the config of a Client
Instance Attribute Summary collapse
-
#encoder ⇒ Object
readonly
Returns the value of attribute encoder.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Config
constructor
Build a config based on opts.
Constructor Details
#initialize(opts = {}) ⇒ Config
Build a config based on opts
17 18 19 20 21 22 |
# File 'lib/linr/config.rb', line 17 def initialize(opts = {}) @host = opts.fetch(:host, "127.0.0.1") @port = opts.fetch(:port, 8089) @logger = opts.fetch(:logger, Logger::Null.new) @encoder = opts.fetch(:encoder, Encoder::Line.new) end |
Instance Attribute Details
#encoder ⇒ Object (readonly)
Returns the value of attribute encoder.
9 10 11 |
# File 'lib/linr/config.rb', line 9 def encoder @encoder end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
6 7 8 |
# File 'lib/linr/config.rb', line 6 def host @host end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/linr/config.rb', line 8 def logger @logger end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/linr/config.rb', line 7 def port @port end |