class BusinessPipeline::Config

Attributes

data[R]

rubocop:enable Style/MissingRespondToMissing

Public Class Methods

new(hash = nil, &block) click to toggle source
Calls superclass method
# File lib/business_pipeline/config.rb, line 7
def initialize(hash = nil, &block)
  super(hash)
  instance_eval(&block) if block
end

Public Instance Methods

fetch(key) { |key| ... } click to toggle source
# File lib/business_pipeline/config.rb, line 12
def fetch(key)
  value = self[key.to_sym]

  return value unless value.nil?
  return yield(key) if block_given?

  fail KeyError, key
end
method_missing(meth, *args, &block) click to toggle source

rubocop:disable Style/MissingRespondToMissing

Calls superclass method
# File lib/business_pipeline/config.rb, line 22
def method_missing(meth, *args, &block)
  if args.size.zero? || meth.to_s.end_with?('=')
    super
  else
    self[meth] = args.first
  end
end