lib/data_provider/container.rb
def add!(container)
      ### add container's providers ###
      # internally providers are added in reverse order (last one first)
      # so at runtime you it's easy and fast to grab the latest provider
      # so when adding now, we have to reverse the providers to get them in the original order
      container.providers.reverse.each do |definition|
        add_provider(*definition)
      end

      ### add container's provides (simple providers) ###
      self.provides(container.provides)

      ### fallback provider ###
      @fallback_provider = container.fallback_provider.block if container.fallback_provider

      ### add container's data ###
      give!(container.data)
    end
def add!(container)
      ### add container's providers ###
      # internally providers are added in reverse order (last one first)
      # so at runtime you it's easy and fast to grab the latest provider
      # so when adding now, we have to reverse the providers to get them in the original order
      container.providers.reverse.each do |definition|
        add_provider(*definition)
      end

      ### add container's provides (simple providers) ###
      self.provides(container.provides)

      ### fallback provider ###
      @fallback_provider = container.fallback_provider.block if container.fallback_provider

      ### add container's data ###
      give!(container.data)
    end
def add! ( container ) ### add container's providers ### # internally providers are added in reverse order (last one first) # so at runtime you it's easy and fast to grab the latest provider # so when adding now, we have to reverse the providers to get them in the original order container . providers . reverse . each do | definition | add_provider ( definition ) end ### add container's provides (simple providers) ### self . provides ( container . provides ) ### fallback provider ### @fallback_provider = container . fallback_provider . block if container . fallback_provider ### add container's data ### give! ( container . data ) end
"adding existing containers"-related methods

 adds all the providers defined in the given module to this class
adding existing containers - related methods