Sha256: 080d9c1d4868edd6d92a33b7cece3e9999094ba499981450ee499e25d55fe1f7

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

class MonoRepoDeps::Config
  def initialize(attributes = {})
    @attributes = attributes
  end

  def read_attribute(key)
    @attributes[key.to_s]
  end

  def write_attribute(key, value)
    @attributes[key.to_s] = value
  end

  def method_missing(method_name, *_args)
    read_attribute(method_name)
  end

  def to_h
    @attributes.each_with_object({}) do |(k, v), h|
      h[k] = self.class === v ? v.to_h : v
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mono_repo_deps-0.2.1 lib/mono_repo_deps/config.rb
mono_repo_deps-0.2.0 lib/mono_repo_deps/config.rb
mono_repo_deps-0.1.14 lib/mono_repo_deps/config.rb
mono_repo_deps-0.1.13 lib/mono_repo_deps/config.rb