Class: NetSuite::Passports::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/netsuite/passports/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account, consumer_key, consumer_secret, token_id, token_secret) ⇒ Token

Returns a new instance of Token.



6
7
8
9
10
11
12
# File 'lib/netsuite/passports/token.rb', line 6

def initialize(, consumer_key, consumer_secret, token_id, token_secret)
  @account = .to_s
  @consumer_key = consumer_key
  @consumer_secret = consumer_secret
  @token_id = token_id
  @token_secret = token_secret
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



4
5
6
# File 'lib/netsuite/passports/token.rb', line 4

def 
  @account
end

#consumer_keyObject (readonly)

Returns the value of attribute consumer_key.



4
5
6
# File 'lib/netsuite/passports/token.rb', line 4

def consumer_key
  @consumer_key
end

#consumer_secretObject (readonly)

Returns the value of attribute consumer_secret.



4
5
6
# File 'lib/netsuite/passports/token.rb', line 4

def consumer_secret
  @consumer_secret
end

#token_idObject (readonly)

Returns the value of attribute token_id.



4
5
6
# File 'lib/netsuite/passports/token.rb', line 4

def token_id
  @token_id
end

#token_secretObject (readonly)

Returns the value of attribute token_secret.



4
5
6
# File 'lib/netsuite/passports/token.rb', line 4

def token_secret
  @token_secret
end

Instance Method Details

#passportObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/netsuite/passports/token.rb', line 14

def passport
  {
    'platformMsgs:tokenPassport' => {
      'platformCore:account' => ,
      'platformCore:consumerKey' => consumer_key,
      'platformCore:token' => token_id,
      'platformCore:nonce' => nonce,
      'platformCore:timestamp' => timestamp,
      'platformCore:signature' => signature,
      :attributes! => { 'platformCore:signature' => { 'algorithm' => 'HMAC-SHA256' } }
    }
  }
end