Class: Tarantool::Client::Configuration
- Inherits:
-
Data
- Object
- Data
- Tarantool::Client::Configuration
- Defined in:
- tarantool-client/lib/tarantool/client/configuration.rb,
tarantool-client/lib/tarantool/client/configuration.rb
Overview
Immutable connection settings built from a URI and keyword options; options win.
Constant Summary collapse
- UNIX_URI =
%r{\Aunix/?:}- UNIX_PATH =
%r{\Aunix/?:(?://(?=/))?(.+)\z}- EMPTY_PATH =
%r{\A/*\z}
Instance Attribute Summary collapse
-
#connect_timeout ⇒ Object
readonly
Returns the value of attribute connect_timeout.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#instrumenter ⇒ Object
readonly
Returns the value of attribute instrumenter.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#max_frame_size ⇒ Object
readonly
Returns the value of attribute max_frame_size.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#reconnect ⇒ Object
readonly
Returns the value of attribute reconnect.
-
#reconnect_attempts ⇒ Object
readonly
Returns the value of attribute reconnect_attempts.
-
#reconnect_delay ⇒ Object
readonly
Returns the value of attribute reconnect_delay.
-
#reconnect_max_delay ⇒ Object
readonly
Returns the value of attribute reconnect_max_delay.
-
#request_timeout ⇒ Object
readonly
Returns the value of attribute request_timeout.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#connect_timeout ⇒ Object (readonly)
Returns the value of attribute connect_timeout
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def connect_timeout @connect_timeout end |
#host ⇒ Object (readonly)
Returns the value of attribute host
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def host @host end |
#instrumenter ⇒ Object (readonly)
Returns the value of attribute instrumenter
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def instrumenter @instrumenter end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def logger @logger end |
#max_frame_size ⇒ Object (readonly)
Returns the value of attribute max_frame_size
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def max_frame_size @max_frame_size end |
#password ⇒ Object (readonly)
Returns the value of attribute password
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def password @password end |
#path ⇒ Object (readonly)
Returns the value of attribute path
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def path @path end |
#port ⇒ Object (readonly)
Returns the value of attribute port
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def port @port end |
#reconnect ⇒ Object (readonly)
Returns the value of attribute reconnect
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def reconnect @reconnect end |
#reconnect_attempts ⇒ Object (readonly)
Returns the value of attribute reconnect_attempts
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def reconnect_attempts @reconnect_attempts end |
#reconnect_delay ⇒ Object (readonly)
Returns the value of attribute reconnect_delay
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def reconnect_delay @reconnect_delay end |
#reconnect_max_delay ⇒ Object (readonly)
Returns the value of attribute reconnect_max_delay
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def reconnect_max_delay @reconnect_max_delay end |
#request_timeout ⇒ Object (readonly)
Returns the value of attribute request_timeout
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def request_timeout @request_timeout end |
#user ⇒ Object (readonly)
Returns the value of attribute user
8 9 10 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 8 def user @user end |
Class Method Details
.build(uri = nil, **options) ⇒ Object
13 14 15 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 13 def self.build(uri = nil, **) new(**defaults, **parse_uri(uri), **) end |
Instance Method Details
#address ⇒ Object
55 56 57 58 59 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 55 def address return path if path host.include?(':') ? "[#{host}]:#{port}" : "#{host}:#{port}" end |
#inspect ⇒ Object Also known as: to_s
61 62 63 64 65 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 61 def inspect fields = to_h.map { |key, value| "#{key}=#{inspect_field(key, value)}" }.join(', ') "#<data #{self.class.name} #{fields}>" end |
#pretty_print(printer) ⇒ Object
68 |
# File 'tarantool-client/lib/tarantool/client/configuration.rb', line 68 def pretty_print(printer) = printer.text(inspect) |