Class: Sekken::XS::PrimaryType

Inherits:
BaseType
  • Object
show all
Defined in:
lib/sekken/xs/types.rb

Direct Known Subclasses

ComplexType, Element, SimpleType

Instance Attribute Summary collapse

Attributes inherited from BaseType

#node

Instance Method Summary collapse

Methods inherited from BaseType

#[], #children, #collect_attributes, #collect_child_elements, #empty?, #inspect

Constructor Details

#initialize(node, schemas, schema = {}) ⇒ PrimaryType

Returns a new instance of PrimaryType.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/sekken/xs/types.rb', line 62

def initialize(node, schemas, schema = {})
  super

  @namespace = schema[:target_namespace]
  @element_form_default = schema[:element_form_default]

  @name = node['name']
  # Because you've overriden the form method, you don't need to set
  # unqualified as the default when no form is specified.
  #@form = node['form'] || 'unqualified'
  @form = node['form']

  @namespaces = node.namespaces
end

Instance Attribute Details

#formObject (readonly)

Returns the value of attribute form.



77
78
79
# File 'lib/sekken/xs/types.rb', line 77

def form
  @form
end

#nameObject (readonly)

Returns the value of attribute name.



77
78
79
# File 'lib/sekken/xs/types.rb', line 77

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



77
78
79
# File 'lib/sekken/xs/types.rb', line 77

def namespace
  @namespace
end

#namespacesObject (readonly)

Returns the value of attribute namespaces.



77
78
79
# File 'lib/sekken/xs/types.rb', line 77

def namespaces
  @namespaces
end