In Files

  • xsd/namedelements.rb

Class/Module Index [+]

Quicksearch

XSD::NamedElements

Constants

Empty

Public Class Methods

new() click to toggle source
 
               # File xsd/namedelements.rb, line 15
def initialize
  @elements = []
  @cache = {}
end
            

Public Instance Methods

+(rhs) click to toggle source
 
               # File xsd/namedelements.rb, line 71
def +(rhs)
  o = NamedElements.new
  o.elements = @elements + rhs.elements
  o
end
            
<<(rhs) click to toggle source
 
               # File xsd/namedelements.rb, line 62
def <<(rhs)
  @elements << rhs
  self
end
            
[](idx) click to toggle source
 
               # File xsd/namedelements.rb, line 40
def [](idx)
  if idx.is_a?(Numeric)
    @elements[idx]
  else
    @cache[idx] ||= @elements.find { |item| item.name == idx }
  end
end
            
concat(rhs) click to toggle source
 
               # File xsd/namedelements.rb, line 77
def concat(rhs)
  @elements.concat(rhs.elements)
  self
end
            
delete(rhs) click to toggle source
 
               # File xsd/namedelements.rb, line 67
def delete(rhs)
  @elements.delete(rhs)
end
            
dup() click to toggle source
 
               # File xsd/namedelements.rb, line 20
def dup
  o = NamedElements.new
  o.elements = @elements.dup
  o
end
            
each() click to toggle source
 
               # File xsd/namedelements.rb, line 56
def each
  @elements.each do |element|
    yield(element)
  end
end
            
empty?() click to toggle source
 
               # File xsd/namedelements.rb, line 32
def empty?
  size == 0
end
            
find_name(name) click to toggle source
 
               # File xsd/namedelements.rb, line 48
def find_name(name)
  @elements.find { |item| item.name.name == name }
end
            
freeze() click to toggle source
 
               # File xsd/namedelements.rb, line 26
def freeze
  super
  @elements.freeze
  self
end
            
keys() click to toggle source
 
               # File xsd/namedelements.rb, line 52
def keys
  collect { |element| element.name }
end
            
size() click to toggle source
 
               # File xsd/namedelements.rb, line 36
def size
  @elements.size
end
            

Protected Instance Methods

elements() click to toggle source
 
               # File xsd/namedelements.rb, line 90
def elements
  @elements
end
            
elements=(rhs) click to toggle source
 
               # File xsd/namedelements.rb, line 86
def elements=(rhs)
  @elements = rhs
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus