Class: RobustClientSocket::ConfigStore
- Inherits:
-
Object
- Object
- RobustClientSocket::ConfigStore
- Defined in:
- lib/robust_client_socket/configuration.rb
Instance Attribute Summary collapse
-
#client_name ⇒ Object
Returns the value of attribute client_name.
-
#header_name ⇒ Object
Returns the value of attribute header_name.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
Instance Method Summary collapse
-
#initialize ⇒ ConfigStore
constructor
A new instance of ConfigStore.
-
#method_missing(name, *args) ⇒ Object
rubocop:disable Style/MissingRespondToMissing.
Constructor Details
#initialize ⇒ ConfigStore
Returns a new instance of ConfigStore.
54 55 56 57 |
# File 'lib/robust_client_socket/configuration.rb', line 54 def initialize @services = {} @client_name = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
rubocop:disable Style/MissingRespondToMissing
59 60 61 62 63 64 65 |
# File 'lib/robust_client_socket/configuration.rb', line 59 def method_missing(name, *args) # rubocop:disable Style/MissingRespondToMissing if name.end_with?('=') @services[name.to_s.delete_suffix('=').to_sym] = args.first.is_a?(Hash) && args.pop else super end end |
Instance Attribute Details
#client_name ⇒ Object
Returns the value of attribute client_name.
52 53 54 |
# File 'lib/robust_client_socket/configuration.rb', line 52 def client_name @client_name end |
#header_name ⇒ Object
Returns the value of attribute header_name.
52 53 54 |
# File 'lib/robust_client_socket/configuration.rb', line 52 def header_name @header_name end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
51 52 53 |
# File 'lib/robust_client_socket/configuration.rb', line 51 def services @services end |