lib/adwords4r/credentials.rb in adwords4r-12.0.0 vs lib/adwords4r/credentials.rb in adwords4r-12.1.0
- old
+ new
@@ -1,10 +1,13 @@
require 'soap/header/simplehandler'
module AdWords
class HeaderHandler < SOAP::Header::SimpleHandler
+ attr_reader :tag
+ attr_writer :value
+
def initialize(tag, value)
super(XSD::QName.new(nil, tag))
@tag = tag
@value = value
end
@@ -38,8 +41,16 @@
credentials = getDefaults()
end
credentials.each {|key, value|
@handlers << HeaderHandler.new(key, value) if !(key =~ /^alternateUrl/)}
@alternateUrl = credentials['alternateUrl']
+ end
+
+ def setHeader(header, value)
+ handlers.each do |handler|
+ if handler.tag == header then
+ handler.value = value
+ end
+ end
end
end
end