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
106 107 108 109 110 |
# File 'lib/adwords4r/credentials.rb', line 106 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
98 99 100 |
# File 'lib/adwords4r/credentials.rb', line 98 def credentials=(value) @credentials = value end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
97 98 99 |
# File 'lib/adwords4r/credentials.rb', line 97 def tag @tag end |
Instance Method Details
#on_simple_outbound ⇒ Object
Handles callback.
113 114 115 116 117 118 119 120 121 |
# File 'lib/adwords4r/credentials.rb', line 113 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 |