class LibXML::XML::Schema::Type

Public Instance Methods

annonymus_subtypes() click to toggle source
# File lib/libxml/schema/type.rb, line 16
def annonymus_subtypes
  elements.select { |_, e| e.type.name.nil? }
end
annonymus_subtypes_recursively(parent=nil) click to toggle source
# File lib/libxml/schema/type.rb, line 20
def annonymus_subtypes_recursively(parent=nil)
  annonymus_subtypes.map do |element_name, e|
    [{[parent, element_name].compact.join('::') => e.type},
     e.type.annonymus_subtypes_recursively(element_name)]
  end.flatten
end
annotation() click to toggle source
# File lib/libxml/schema/type.rb, line 8
def annotation
  return if node.nil?
  annotations = node.children.select { |n| n.name == 'annotation' }
  annotations.map do |annotation|
    annotation.children.map(&:content).join("\n")
  end.join("\n")
end
kind_name() click to toggle source
# File lib/libxml/schema/type.rb, line 4
def kind_name
  Schema::Types.constants.find { |k| Schema::Types.const_get(k) == kind }
end