Class: Lutaml::Model::Schema::XmlCompiler::SimpleContent

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/model/schema/xml_compiler/simple_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSimpleContent

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_classObject

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

#instancesObject

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_filesObject



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