lib/docrb/lib/docrb/doc_compiler/base_container.rb
# Attempts to append a given object defined in a provided filename.
# Raises ArgumentError in case the object can't be added to the container
# due to type contraints.
#
# filename - Filename defining the object being appended
# obj      - The object definition to be appended to this container.
Attempts to append a given object defined in a provided filename.
Raises ArgumentError in case the object can't be added to the container
due to type contraints.

Filename defining the object being appended
obj      - The object definition to be appended to this container.
Attempts to append a given object defined in a provided filename . Raises ArgumentError in case the object can ' t be added to the container due to type contraints . Filename defining the object being appended obj - The object definition to be appended to this container .
def append(filename, obj)
        raise ArgumentError, "cannot append obj of type #{obj[:type]} into #{@name} (#{@type})" if obj[:type] != @type
        raise ArgumentError, "cannot append obj named #{obj[:name]} into #{@name} (#{@type})" if obj[:name] != @name
        unless (doc = obj[:doc]).nil?
          @defined_by.push(filename, obj)
          @doc = doc
        end
        obj.fetch(:classes, []).each { |c| @classes.push(filename, c) }
        obj.fetch(:modules, []).each { |m| @modules.push(filename, m) }
        obj.fetch(:extend, []).each { |e| @extends << e }
        obj.fetch(:include, []).each { |i| @includes << i }
        obj.fetch(:methods, []).each do |met|
          if met[:type] == :def
            @defs.push(filename, met)
          else
            @sdefs.push(filename, met)
          end
        end
        @inherits = obj.fetch(:inherits, nil) if obj[:type] == :class
        appended(filename, obj)
      end
def append ( filename , obj ) raise ArgumentError , "cannot append obj of type #{obj[:type]} into #{@name} (#{@type})" if obj [ :type ] != @type raise ArgumentError , "cannot append obj named #{obj[:name]} into #{@name} (#{@type})" if obj [ :name ] != @name unless ( doc = obj [ :doc ] ) . nil? @defined_by . push ( filename , obj ) @doc = doc end obj . fetch ( :classes , [ ] ) . each { | c | @classes . push ( filename , c ) } obj . fetch ( :modules , [ ] ) . each { | m | @modules . push ( filename , m ) } obj . fetch ( :extend , [ ] ) . each { | e | @extends << e } obj . fetch ( :include , [ ] ) . each { | i | @includes << i } obj . fetch ( :methods , [ ] ) . each do | met | if met [ :type ] == :def @defs . push ( filename , met ) else @sdefs . push ( filename , met ) end end @inherits = obj . fetch ( :inherits , nil ) if obj [ :type ] == :class appended ( filename , obj ) end
Attempts to append a given object defined in a provided filename.
Attempts to append a given object defined in a provided filename .
filename
obj