Class: AdfBuilder::Nodes::Option

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

#initializeOption

Returns a new instance of Option.



147
148
149
150
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 147

def initialize
  super
  @tag_name = :option
end

Dynamic Method Handling

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

Instance Method Details

#manufacturercode(value) ⇒ Object



156
157
158
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 156

def manufacturercode(value)
  add_child(GenericNode.new(:manufacturercode, {}, value))
end

#optionname(value) ⇒ Object



152
153
154
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 152

def optionname(value)
  add_child(GenericNode.new(:optionname, {}, value))
end

#price(value, **attrs) ⇒ Object



168
169
170
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 168

def price(value, **attrs)
  add_child(Price.new(value, **attrs))
end

#stock(value) ⇒ Object



160
161
162
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 160

def stock(value)
  add_child(GenericNode.new(:stock, {}, value))
end

#weighting(value) ⇒ Object



164
165
166
# File 'lib/adf_builder/nodes/vehicle_nodes.rb', line 164

def weighting(value)
  add_child(Weighting.new(value))
end