Class: Naver::Searchad::Api::Auth::CustomerAcccountCredentials
- Inherits:
-
Object
- Object
- Naver::Searchad::Api::Auth::CustomerAcccountCredentials
- Defined in:
- lib/naver/searchad/api/auth.rb
Constant Summary collapse
- TIMESTAMP_HEADER =
'X-Timestamp'.freeze
- API_KEY_HEADER =
'X-API-KEY'.freeze
- CUSTOMER_HEADER =
'X-Customer'.freeze
- SIGNATURE_HEADER =
'X-Signature'.freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
Instance Method Summary collapse
- #apply(hash, request_uri, method) ⇒ Object
-
#initialize(api_key, api_secret, customer_id) ⇒ CustomerAcccountCredentials
constructor
A new instance of CustomerAcccountCredentials.
Constructor Details
#initialize(api_key, api_secret, customer_id) ⇒ CustomerAcccountCredentials
Returns a new instance of CustomerAcccountCredentials.
15 16 17 18 19 |
# File 'lib/naver/searchad/api/auth.rb', line 15 def initialize(api_key, api_secret, customer_id) @api_key = api_key @api_secret = api_secret @customer_id = customer_id end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/naver/searchad/api/auth.rb', line 11 def api_key @api_key end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
12 13 14 |
# File 'lib/naver/searchad/api/auth.rb', line 12 def api_secret @api_secret end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
13 14 15 |
# File 'lib/naver/searchad/api/auth.rb', line 13 def customer_id @customer_id end |
Instance Method Details
#apply(hash, request_uri, method) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/naver/searchad/api/auth.rb', line 21 def apply(hash, request_uri, method) = Time.now.to_i hash[TIMESTAMP_HEADER] = hash[API_KEY_HEADER] = api_key hash[CUSTOMER_HEADER] = customer_id hash[SIGNATURE_HEADER] = generate_signature(api_secret, request_uri, method, ) end |