Module: XSD::Based

Included in:
Extension, Restriction
Defined in:
lib/xsd/shared/based.rb

Overview

Used by extension and restriction elements

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#baseObject

Required. Specifies the name of a built-in data type, a simpleType element, or a complexType element

Returns:

  • String



# File 'lib/xsd/shared/based.rb', line 6

#base_complex_typeObject

Base complexType

Returns:

  • ComplexType, nil



# File 'lib/xsd/shared/based.rb', line 10

#base_simple_typeObject

Base simpleType

Returns:

  • SimpleType, nil



17
18
19
20
21
# File 'lib/xsd/shared/based.rb', line 17

def self.included(obj)
  obj.property :base, :string, required: true
  obj.link :base_complex_type, :complexType, property: :base
  obj.link :base_simple_type, :simpleType, property: :base
end

Class Method Details

.included(obj) ⇒ Object

Base simpleType

Returns:

  • SimpleType, nil



17
18
19
20
21
# File 'lib/xsd/shared/based.rb', line 17

def self.included(obj)
  obj.property :base, :string, required: true
  obj.link :base_complex_type, :complexType, property: :base
  obj.link :base_simple_type, :simpleType, property: :base
end

Instance Method Details

#collect_attributes(include_base = true) ⇒ Object

Get all available attributes on the current stack level, optionally including base type attributes

Parameters:

  • include_base (Boolean) (defaults to: true)


33
34
35
# File 'lib/xsd/shared/based.rb', line 33

def collect_attributes(include_base = true)
  (include_base && base_complex_type ? base_complex_type.collect_attributes : []) + super
end

#collect_elements(include_base = true) ⇒ Object

Get all available elements on the current stack level, optionally including base type elements

Parameters:

  • include_base (Boolean) (defaults to: true)


26
27
28
# File 'lib/xsd/shared/based.rb', line 26

def collect_elements(include_base = true)
  (include_base && base_complex_type ? base_complex_type.collect_elements : []) + super
end