Sha256: 5427e5a48db12136406778b19fe8211e3a1fbe8c9f52a5c405382297d19d2a1b
Contents?: true
Size: 1.43 KB
Versions: 17
Compression:
Stored size: 1.43 KB
Contents
module Eco module API class Session class Config class BaseConfig < Hash class << self def attr_key(*attrs) attrs.each do |attr| method = attr.to_s.freeze if instance_methods.include?(method.to_sym) puts "WARNING (#{self}): redefining method already defined '#{method}'." end define_method method do self[method] end define_method "#{method}=" do |value| self[method] = value end end self end end include Eco::Language::AuxiliarLogger attr_reader :config def initialize(config:) super(nil) @config = config end def file_manager config.file_manager end def apis config.apis end def clone(config:) keys.each_with_object(self.class.new(config: config)) do |key, cnf| 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 end end end end
Version data entries
17 entries across 17 versions & 1 rubygems