Module: InheritableAccessors::InheritableOptionAccessor

Extended by:
ActiveSupport::Concern
Defined in:
lib/inheritable_accessors/inheritable_option_accessor.rb

Defined Under Namespace

Modules: ClassMethods Classes: LetOption

Class Method Summary collapse

Class Method Details

.__inheritable_option(context, options_hash, name, value, &block) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'lib/inheritable_accessors/inheritable_option_accessor.rb', line 47

def self.__inheritable_option(context, options_hash, name, value, &block)
  if value
    options_hash[name] = value
  elsif block_given?
    options_hash[name] = InheritableOptionAccessor::LetOption.new(block)
  else
    options_hash[name].instance_of?(InheritableOptionAccessor::LetOption) ? options_hash[name].with_context(context) : options_hash[name]
  end
end