Parent

Methods

Class/Module Index [+]

Quicksearch

YARD::CodeObjects::CodeObjectList

A list of code objects. This array acts like a set (no unique items) but also disallows any {Proxy} objects from being added.

Public Class Methods

new(owner = Registry.root) click to toggle source

Creates a new object list associated with a namespace

@param [NamespaceObject] owner the namespace the list should be associated with @return [CodeObjectList]

# File lib/yard/code_objects/base.rb, line 10
def initialize(owner = Registry.root)
  @owner = owner
end

Public Instance Methods

<<(value) click to toggle source
Alias for: push
push(value) click to toggle source

Adds a new value to the list

@param [Base] value a code object to add @return [CodeObjectList] self

# File lib/yard/code_objects/base.rb, line 18
def push(value)
  value = Proxy.new(@owner, value) if value.is_a?(String) || value.is_a?(Symbol)
  if value.is_a?(CodeObjects::Base) || value.is_a?(Proxy)
    super(value) unless include?(value)
  else
    raise ArgumentError, "#{value.class} is not a valid CodeObject"
  end
  self
end
Also aliased as: <<

[Validate]

Generated with the Darkfish Rdoc Generator 2.