Class: YARD::CodeObjects::CodeObjectList
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::Array
|
|
Instance Chain:
self,
::Array
|
|
Inherits: |
Array
|
Defined in: | lib/yard/code_objects/base.rb |
Overview
A list of code objects. This array acts like a set (no unique items)
but also disallows any Proxy
objects from being added.
Class Method Summary
-
.new(owner = Registry.root) ⇒ CodeObjectList
constructor
Creates a new object list associated with a namespace.
Instance Method Summary
-
#<<(value)
Alias for #push.
-
#push(value) ⇒ CodeObjectList
(also: #<<)
Adds a new value to the list.
::Array
- Inherited
#place | Places values before or after another object (by value) in an array. |
Constructor Details
.new(owner = Registry.root) ⇒ CodeObjectList
Creates a new object list associated with a namespace
Instance Method Details
#<<(value)
Alias for #push.
# File 'lib/yard/code_objects/base.rb', line 28
alias << push
#push(value) ⇒ CodeObjectList
Also known as: #<<
Adds a new value to the list
# File 'lib/yard/code_objects/base.rb', line 19
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