Class: AdfBuilder::Nodes::Id

Inherits:
Node
  • Object
show all
Defined in:
lib/adf_builder/nodes/shared.rb

Instance Attribute Summary

Attributes inherited from Node

#attributes, #children, #tag_name, #value

Instance Method Summary collapse

Methods inherited from Node

#add_child, #method_missing, #remove_children, #respond_to_missing?, #to_xml

Methods included from Validations

included, #validate!

Constructor Details

#initialize(value, source:, sequence: nil) ⇒ Id

Returns a new instance of Id.

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
13
14
# File 'lib/adf_builder/nodes/shared.rb', line 6

def initialize(value, source:, sequence: nil)
  super()
  raise ArgumentError, "Source is required" if source.nil?

  @tag_name = :id
  @value = value
  @attributes[:sequence] = sequence if sequence
  @attributes[:source] = source
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AdfBuilder::Nodes::Node