class Sekken::XS::SchemaCollection

Public Class Methods

new() click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 6
def initialize
  @schemas = []
end

Public Instance Methods

<<(schema) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 10
def <<(schema)
  @schemas << schema
end
attribute(namespace, name) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 22
def attribute(namespace, name)
  find_by_namespace(namespace).attributes[name]
end
attribute_group(namespace, name) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 26
def attribute_group(namespace, name)
  find_by_namespace(namespace).attribute_groups[name]
end
complex_type(namespace, name) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 34
def complex_type(namespace, name)
  find_by_namespace(namespace).complex_types[name]
end
each(&block) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 18
def each(&block)
  @schemas.each(&block)
end
element(namespace, name) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 30
def element(namespace, name)
  find_by_namespace(namespace).elements[name]
end
find_by_namespace(namespace) click to toggle source

TODO: store by namespace instead?

# File lib/sekken/xs/schema_collection.rb, line 43
def find_by_namespace(namespace)
  find { |schema| schema.target_namespace == namespace }
end
push(schemas) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 14
def push(schemas)
  @schemas += schemas
end
simple_type(namespace, name) click to toggle source
# File lib/sekken/xs/schema_collection.rb, line 38
def simple_type(namespace, name)
  find_by_namespace(namespace).simple_types[name]
end