Class: AdWords::Pre2009HeaderHandler
- Inherits:
-
SOAP::Header::SimpleHandler
- Object
- SOAP::Header::SimpleHandler
- AdWords::Pre2009HeaderHandler
- Defined in:
- lib/adwords4r/credentials.rb
Overview
Handles the headers used in <= v13 (both sandbox and production)
Instance Attribute Summary collapse
-
#credentials ⇒ Object
writeonly
Sets the attribute credentials.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(tag, credentials) ⇒ Pre2009HeaderHandler
constructor
Constructor for Pre2009HeaderHandler.
-
#on_simple_outbound ⇒ Object
Handles callback.
Constructor Details
#initialize(tag, credentials) ⇒ Pre2009HeaderHandler
Constructor for Pre2009HeaderHandler.
Args:
-
tag: XML tag name to be handled (email, password, etc.)
-
value: value to be sent inside tag on outgoing requests
111 112 113 114 115 |
# File 'lib/adwords4r/credentials.rb', line 111 def initialize(tag, credentials) super(XSD::QName.new(nil, tag)) @tag = tag @credentials = credentials end |
Instance Attribute Details
#credentials=(value) ⇒ Object (writeonly)
Sets the attribute credentials
103 104 105 |
# File 'lib/adwords4r/credentials.rb', line 103 def credentials=(value) @credentials = value end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
102 103 104 |
# File 'lib/adwords4r/credentials.rb', line 102 def tag @tag end |
Instance Method Details
#on_simple_outbound ⇒ Object
Handles callback.
118 119 120 121 122 123 124 125 126 |
# File 'lib/adwords4r/credentials.rb', line 118 def on_simple_outbound if @tag == 'clientEmail' return @credentials.client_email elsif @tag == 'clientCustomerId' return @credentials.client_customer_id else @credentials.credentials[@tag] end end |