lib/amazon_product_advertising_api/operations/base.rb
# Defines a new accessor on the element and if supplied assigns that attribute a value.
Defines a new accessor on the element and if supplied assigns that attribute a value.
Defines a new accessor on the element and if supplied assigns that attribute a value .
def add_element(name, value = nil)
          name = name.underscore
          @attributes[name.to_s] = value
          self.instance_eval %{
            def self.#{name}
              @#{name}
            end
            def self.#{name}=(value)
              @#{name} ||= value
            end
          }
          if !value.nil?
            value = value.to_s if value.is_a?(Symbol)
            self.send("#{name}=", value)
          end
          self.instance_eval("self.#{name}")
        end
def add_element ( name , value = nil ) name = name . underscore @attributes [ name . to_s ] = value self . instance_eval %{
            def self.#{name}
              @#{name}
            end
            def self.#{name}=(value)
              @#{name} ||= value
            end
          } if ! value . nil? value = value . to_s if value . is_a? ( Symbol ) self . send ( "#{name}=" , value ) end self . instance_eval ( "self.#{name}" ) end
Defines a new accessor on the element and if supplied assigns that attribute a value.
Defines a new accessor on the element and if supplied assigns that attribute a value .
# Return the element
name
<not_specific>
value
<not_specific>