Class: ScaffoldParser::Scaffolders::XSD::Parser::Handlers::ModuleInclude
- Inherits:
-
Object
- Object
- ScaffoldParser::Scaffolders::XSD::Parser::Handlers::ModuleInclude
- Defined in:
- lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb
Instance Attribute Summary collapse
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #complex_type(new_source) ⇒ Object
- #element(new_source) ⇒ Object
- #full_ref ⇒ Object
-
#initialize(source) ⇒ ModuleInclude
constructor
A new instance of ModuleInclude.
- #sequence(_) ⇒ Object
Constructor Details
#initialize(source) ⇒ ModuleInclude
Returns a new instance of ModuleInclude.
9 10 11 12 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 9 def initialize(source) @source = source @ref = @source.ref&.camelize end |
Instance Attribute Details
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
7 8 9 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 7 def ref @ref end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 7 def source @source end |
Instance Method Details
#complex_type(new_source) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 26 def complex_type(new_source) if new_source.has_name? STACK.push Klass.new(new_source, self) else self end end |
#element(new_source) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 34 def element(new_source) if new_source.has_name? new_class = STACK.push Klass.new(new_source, self) SubmodelMethod.new(new_source, new_class.name_with_prefix) end end |
#full_ref ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/scaffold_parser/scaffolders/xsd/parser/handlers/module_include.rb', line 14 def full_ref if ref.include? ':' [ref.split(':')[0], 'groups', ref.split(':')[1]].compact.map(&:camelize).join('::') else [source.xmlns_prefix, 'groups', ref].compact.map(&:camelize).join('::') end end |