Class: RailsBand::Configuration::Consumers

Inherits:
ActiveSupport::HashWithIndifferentAccess
  • Object
show all
Defined in:
lib/rails_band/configuration.rb

Overview

Consumers is a wrapper of ActiveSupport::HashWithIndifferentAccess, which validates the value on #[]=.

Instance Method Summary collapse

Instance Method Details

#[]=(key, value) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rails_band/configuration.rb', line 8

def []=(key, value)
  unless value.respond_to?(:call)
    raise ArgumentError, "The value for `#{key.inspect}` must have #call: the passed one is `#{value.inspect}`"
  end

  super
end