lib/k_builder/base_configuration.rb
def attach_config_to_parent(klass_child, klass_parent, accessor_name)
        # Create a memoized getter to an instance of the attaching class (:klass_child)
        #
        # def third_party
        #   @third_party ||= KBuilder::ThirdPartyGem::Configuration.new
        # end
        klass_parent.send(:define_method, accessor_name) do
          return instance_variable_get("@#{accessor_name}") if instance_variable_defined?("@#{accessor_name}")

          instance_variable_set("@#{accessor_name}", klass_child.new)
        end
      end
# Attach a child configuration with it's own settings to a parent configuration
#
# @param [Class] klass_child what class would you like as the child
# @param [Class] klass_parent what class would you like to extend with a new child configuration
# @param [Symbol] accessor_name what is the name of the accessor that you are adding
Attach a child configuration with it's own settings to a parent configuration
Attach a child configuration with it ' s own settings to a parent configuration
def attach_config_to_parent(klass_child, klass_parent, accessor_name)
         def third_party
           @third_party ||= KBuilder::ThirdPartyGem::Configuration.new
         end
        klass_parent.send(:define_method, accessor_name) do
          return instance_variable_get("@{accessor_name}") if instance_variable_defined?("@{accessor_name}")
          instance_variable_set("@{accessor_name}", klass_child.new)
        end
      end
def attach_config_to_parent ( klass_child , klass_parent , accessor_name ) klass_parent . send ( :define_method , accessor_name ) do return instance_variable_get ( "@#{accessor_name}" ) if instance_variable_defined? ( "@#{accessor_name}" ) instance_variable_set ( "@#{accessor_name}" , klass_child . new ) end end
Attach a child configuration with it's own settings to a parent configuration
Attach a child configuration with it ' s own settings to a parent configuration
# Create a memoized getter to an instance of the attaching class (:klass_child) # # def third_party #   @third_party ||= KBuilder::ThirdPartyGem::Configuration.new # end
klass_child
klass_parent
accessor_name
accessor_name what is the name of the accessor that you are adding
accessor_name what is the name of the accessor that you are adding