Class: ScaffoldParser::Scaffolders::XSD::Parser::Handlers::Sequence

Inherits:
Object
  • Object
show all
Includes:
OrderElements
Defined in:
lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OrderElements

#all, #choice, #sequence

Constructor Details

#initialize(elements = []) ⇒ Sequence

Returns a new instance of Sequence.



10
11
12
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb', line 10

def initialize(elements = [])
  @elements = [*elements]
end

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



8
9
10
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb', line 8

def elements
  @elements
end

Instance Method Details

#complex_type(source) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb', line 14

def complex_type(source)
  if source.has_name?
    STACK.push Klass.new(source, elements)
  end

  ComplexType.new elements
end

#extension(source) ⇒ Object



26
27
28
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb', line 26

def extension(source)
  Extension.new elements, source.attributes
end

#group(source) ⇒ Object



22
23
24
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/sequence.rb', line 22

def group(source)
  STACK.push Module.new(source, elements)
end