lib/docrb/lib/docrb/doc_compiler/object_container.rb
def push(filename, obj)
        if @cls.method_defined?(:name) &&
           (instance = @objects.find { |o| o.name == obj[:name] }) &&
           !@opts.fetch(:always_append, false)

          return instance.merge(filename, obj) if instance.respond_to? :merge
          return instance.override(filename, obj) if instance.respond_to? :override
          return instance.append(filename, obj) if instance.respond_to? :append

          raise ArgumentError, "cannot handle existing object #{obj[:name]} for container of type #{@cls.name}"
        end

        inst = @cls.new(@parent, filename, obj)
        @objects << inst
        inst
      end
# Pushes a new object into the container. May raise ArgumentError in case
# the object being pushed is not compatible with the container's base
# object.
#
# filename - Name of the file which defines the object being pushed
# obj      - The object being pushed
#
# Returns the new instance representing the pushed object.
Pushes a new object into the container. May raise ArgumentError in case
the object being pushed is not compatible with the container's base
object.

Name of the file which defines the object being pushed
obj      - The object being pushed

Returns the new instance representing the pushed object.
Pushes a new object into the container . May raise ArgumentError in case the object being pushed is not compatible with the container ' s base object . Name of the file which defines the object being pushed obj - The object being pushed Returns the new instance representing the pushed object .
def push(filename, obj)
        if @cls.method_defined?(:name) &&
           (instance = @objects.find { |o| o.name == obj[:name] }) &&
           !@opts.fetch(:always_append, false)
          return instance.merge(filename, obj) if instance.respond_to? :merge
          return instance.override(filename, obj) if instance.respond_to? :override
          return instance.append(filename, obj) if instance.respond_to? :append
          raise ArgumentError, "cannot handle existing object #{obj[:name]} for container of type #{@cls.name}"
        end
        inst = @cls.new(@parent, filename, obj)
        @objects << inst
        inst
      end
def push ( filename , obj ) if @cls . method_defined? ( :name ) && ( instance = @objects . find { | o | o . name == obj [ :name ] } ) && ! @opts . fetch ( :always_append , false ) return instance . merge ( filename , obj ) if instance . respond_to? :merge return instance . override ( filename , obj ) if instance . respond_to? :override return instance . append ( filename , obj ) if instance . respond_to? :append raise ArgumentError , "cannot handle existing object #{obj[:name]} for container of type #{@cls.name}" end inst = @cls . new ( @parent , filename , obj ) @objects << inst inst end
Pushes a new object into the container.
Pushes a new object into the container .
filename
obj