Class: Lutaml::Model::Schema::XmlCompiler::SimpleContent
- Inherits:
-
Object
- Object
- Lutaml::Model::Schema::XmlCompiler::SimpleContent
- Defined in:
- lib/lutaml/model/schema/xml_compiler/simple_content.rb
Instance Attribute Summary collapse
-
#base_class ⇒ Object
Returns the value of attribute base_class.
-
#instances ⇒ Object
Returns the value of attribute instances.
Instance Method Summary collapse
- #<<(instance) ⇒ Object
-
#initialize ⇒ SimpleContent
constructor
A new instance of SimpleContent.
- #required_files ⇒ Object
- #to_attributes(indent = nil) ⇒ Object
- #to_xml_mapping(indent = nil) ⇒ Object
Constructor Details
#initialize ⇒ SimpleContent
Returns a new instance of SimpleContent.
10 11 12 13 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 10 def initialize @instances = [] @base_class = nil end |
Instance Attribute Details
#base_class ⇒ Object
Returns the value of attribute base_class.
8 9 10 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 8 def base_class @base_class end |
#instances ⇒ Object
Returns the value of attribute instances.
8 9 10 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 8 def instances @instances end |
Instance Method Details
#<<(instance) ⇒ Object
15 16 17 18 19 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 15 def <<(instance) return if instance.nil? @instances << instance end |
#required_files ⇒ Object
29 30 31 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 29 def required_files instances.map(&:required_files).flatten.compact.uniq end |
#to_attributes(indent = nil) ⇒ Object
21 22 23 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 21 def to_attributes(indent = nil) instances.filter_map { |instance| instance.to_attributes(indent) }.join("\n") end |
#to_xml_mapping(indent = nil) ⇒ Object
25 26 27 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 25 def to_xml_mapping(indent = nil) instances.filter_map { |instance| instance.to_xml_mapping(indent) }.join("\n") end |