Class: ScaffoldParser::Scaffolders::XSD::Parser::Handlers::Choice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OrderElements

#all, #choice, #sequence

Constructor Details

#initialize(elements = []) ⇒ Choice

Returns a new instance of Choice.



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

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

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



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

def elements
  @elements
end

Instance Method Details

#complex_type(source) ⇒ Object



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

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

#extension(source) ⇒ Object



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

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