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
33 34 35 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 33 def required_files instances.flat_map(&:required_files).compact.uniq end |
#to_attributes(indent = nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 21 def to_attributes(indent = nil) instances.filter_map do |instance| instance.to_attributes(indent) end.join("\n") end |
#to_xml_mapping(indent = nil) ⇒ Object
27 28 29 30 31 |
# File 'lib/lutaml/model/schema/xml_compiler/simple_content.rb', line 27 def to_xml_mapping(indent = nil) instances.filter_map do |instance| instance.to_xml_mapping(indent) end.join("\n") end |