XSD::NamedElements (Class)

In: xsd/namedelements.rb
Parent: Object

Methods

+   <<   []   concat   delete   dup   each   find_name   new   size  

Included Modules

Enumerable

Public Class methods

[Source]

# File xsd/namedelements.rb, line 15
  def initialize
    @elements = []
    @cache = {}
  end

Public Instance methods

[Source]

# File xsd/namedelements.rb, line 57
  def +(rhs)
    o = NamedElements.new
    o.elements = @elements + rhs.elements
    o
  end

[Source]

# File xsd/namedelements.rb, line 48
  def <<(rhs)
    @elements << rhs
    self
  end

[Source]

# File xsd/namedelements.rb, line 30
  def [](idx)
    if idx.is_a?(Numeric)
      @elements[idx]
    else
      @cache[idx] ||= @elements.find { |item| item.name == idx }
    end
  end

[Source]

# File xsd/namedelements.rb, line 63
  def concat(rhs)
    @elements.concat(rhs.elements)
    self
  end

[Source]

# File xsd/namedelements.rb, line 53
  def delete(rhs)
    @elements.delete(rhs)
  end

[Source]

# File xsd/namedelements.rb, line 20
  def dup
    o = NamedElements.new
    o.elements = @elements.dup
    o
  end

[Source]

# File xsd/namedelements.rb, line 42
  def each
    @elements.each do |element|
      yield(element)
    end
  end

[Source]

# File xsd/namedelements.rb, line 38
  def find_name(name)
    @elements.find { |item| item.name.name == name }
  end

[Source]

# File xsd/namedelements.rb, line 26
  def size
    @elements.size
  end

[Validate]