Module: XSD::ComplexTyped

Included in:
Element
Defined in:
lib/xsd/shared/complex_typed.rb

Overview

Provides object an ability to have complex type (nested or linked)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#complex_typeObject

Child/linked complex type

Returns:

  • ComplexType, nil



9
10
11
12
# File 'lib/xsd/shared/complex_typed.rb', line 9

def self.included(obj)
  obj.child :complex_type, :complexType
  obj.link :complex_type, :complexType, property: obj::TYPE_PROPERTY
end

Class Method Details

.included(obj) ⇒ Object

Child/linked complex type

Returns:

  • ComplexType, nil



9
10
11
12
# File 'lib/xsd/shared/complex_typed.rb', line 9

def self.included(obj)
  obj.child :complex_type, :complexType
  obj.link :complex_type, :complexType, property: obj::TYPE_PROPERTY
end

Instance Method Details

#collect_attributes(linked_type = true) ⇒ Object

Get all available attributes on the current stack level or linked type attributes

Parameters:

  • linked_type (Boolean) (defaults to: true)


24
25
26
# File 'lib/xsd/shared/complex_typed.rb', line 24

def collect_attributes(linked_type = true)
  (linked_type && complex_type&.linked? ? complex_type.collect_attributes : super)
end

#collect_elements(linked_type = true) ⇒ Object

Get all available elements on the current stack level or linked type elements

Parameters:

  • linked_type (Boolean) (defaults to: true)


17
18
19
# File 'lib/xsd/shared/complex_typed.rb', line 17

def collect_elements(linked_type = true)
  (linked_type && complex_type&.linked? ? complex_type.collect_elements : super)
end