Class: ScaffoldParser::Scaffolders::XSD::Parser::Handlers::Extension
- Inherits:
-
Object
- Object
- ScaffoldParser::Scaffolders::XSD::Parser::Handlers::Extension
- Defined in:
- lib/scaffold_parser/scaffolders/xsd/parser/handlers/extension.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#elements ⇒ Object
Returns the value of attribute elements.
Instance Method Summary collapse
- #complex_type(source) ⇒ Object
-
#initialize(elements = [], attributes) ⇒ Extension
constructor
A new instance of Extension.
Constructor Details
#initialize(elements = [], attributes) ⇒ Extension
Returns a new instance of Extension.
9 10 11 12 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/extension.rb', line 9 def initialize(elements = [], attributes) @elements = [*elements] @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/extension.rb', line 7 def attributes @attributes end |
#elements ⇒ Object
Returns the value of attribute elements.
7 8 9 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/extension.rb', line 7 def elements @elements end |
Instance Method Details
#complex_type(source) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/extension.rb', line 14 def complex_type(source) if source.has_name? template = Klass.new(source, elements) do |template| template.inherit_from = attributes['base'].camelize end STACK.push template else ComplexType.new elements + [ClassInherit.new(attributes['base'])] end end |