Class: Obscured::Doorman::Providers::Bitbucket::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/obscured-doorman/providers/bitbucket/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AccessToken

Returns a new instance of AccessToken.



15
16
17
18
19
20
21
22
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 15

def initialize(attributes = {})
  @access_token = attributes[:access_token]
  @refresh_token = attributes[:refresh_token]
  @scopes = attributes[:scopes]
  @expires_in = attributes[:expires_in]
  @expires_date = DateTime.now + expires_in.to_i.seconds
  @emails = attributes[:emails]
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



8
9
10
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 8

def access_token
  @access_token
end

#emailsObject

Returns the value of attribute emails.



13
14
15
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 13

def emails
  @emails
end

#expires_dateObject

Returns the value of attribute expires_date.



12
13
14
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 12

def expires_date
  @expires_date
end

#expires_inObject

Returns the value of attribute expires_in.



11
12
13
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 11

def expires_in
  @expires_in
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



9
10
11
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 9

def refresh_token
  @refresh_token
end

#scopesObject

Returns the value of attribute scopes.



10
11
12
# File 'lib/obscured-doorman/providers/bitbucket/access_token.rb', line 10

def scopes
  @scopes
end