Class: Eco::API::Session::Config::BaseConfig
- Defined in:
- lib/eco/api/session/config/base_config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #clone(config:) ⇒ Object
-
#initialize(config:) ⇒ BaseConfig
constructor
A new instance of BaseConfig.
Methods inherited from Hash
Constructor Details
#initialize(config:) ⇒ BaseConfig
Returns a new instance of BaseConfig.
9 10 11 12 |
# File 'lib/eco/api/session/config/base_config.rb', line 9 def initialize(config:) super(nil) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/eco/api/session/config/base_config.rb', line 7 def config @config end |
Instance Method Details
#clone(config:) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/eco/api/session/config/base_config.rb', line 14 def clone(config:) keys.each_with_object(self.class.new(config: config)) do |key, cnf| begin cnf[key] = self[key].clone(config: cnf) rescue ArgumentError begin cnf[key] = self[key].clone rescue TypeError cnf[key] = self[key] end end end end |