Class: AdfBuilder::Nodes::Price

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: :quote, currency: nil, delta: nil, relativeto: nil, source: nil) ⇒ Price

Returns a new instance of Price.



86
87
88
89
90
91
92
93
94
95
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 86

def initialize(value, type: :quote, currency: nil, delta: nil, relativeto: nil, source: nil)
  super()
  @tag_name = :price
  @value = value
  @attributes[:type] = type
  @attributes[:currency] = currency if currency
  @attributes[:delta] = delta if delta
  @attributes[:relativeto] = relativeto if relativeto
  @attributes[:source] = source if source
end

Dynamic Method Handling

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