Class: RobustClientSocket::ConfigStore

Inherits:
Object
  • Object
show all
Defined in:
lib/robust_client_socket/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigStore

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_nameObject

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_nameObject

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

#servicesObject (readonly)

Returns the value of attribute services.



51
52
53
# File 'lib/robust_client_socket/configuration.rb', line 51

def services
  @services
end