Class: Eco::API::Session::Config::BaseConfig

Inherits:
Hash
  • Object
show all
Defined in:
lib/eco/api/session/config/base_config.rb

Direct Known Subclasses

Apis, Files, Logger, Mailer, People, PostLaunch, S3Storage, SFTP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#deep_merge, #deep_merge!

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

#configObject (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