Class: Lutaml::Model::Schema::XmlCompiler::AttributeGroup

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, ref: nil) ⇒ AttributeGroup



10
11
12
13
14
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 10

def initialize(name: nil, ref: nil)
  @name = name
  @ref = ref
  @instances = []
end

Instance Attribute Details

#instancesObject

Returns the value of attribute instances.



8
9
10
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 8

def instances
  @instances
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 8

def name
  @name
end

#refObject

Returns the value of attribute ref.



8
9
10
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 8

def ref
  @ref
end

Instance Method Details

#<<(instance) ⇒ Object



16
17
18
19
20
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 16

def <<(instance)
  return if instance.nil?

  @instances << instance
end

#required_filesObject



30
31
32
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 30

def required_files
  resolved_instances.map(&:required_files)
end

#to_attributes(indent) ⇒ Object



22
23
24
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 22

def to_attributes(indent)
  resolved_instances.map { |instance| instance.to_attributes(indent) }
end

#to_xml_mapping(indent) ⇒ Object



26
27
28
# File 'lib/lutaml/model/schema/xml_compiler/attribute_group.rb', line 26

def to_xml_mapping(indent)
  resolved_instances.map { |instance| instance.to_xml_mapping(indent) }
end