Class: AdfBuilder::Nodes::Amount

Inherits:
Node
  • Object
show all
Defined in:
lib/adf_builder/nodes/vehicle_nodes.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, type: :total, limit: :maximum, currency: nil) ⇒ Amount

Returns a new instance of Amount.



103
104
105
106
107
108
109
110
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 103

def initialize(value, type: :total, limit: :maximum, currency: nil)
  super()
  @tag_name = :amount
  @value = value
  @attributes[:type] = type
  @attributes[:limit] = limit
  @attributes[:currency] = currency if currency
end

Dynamic Method Handling

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