Class: Ofx::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/authentication.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, client_secret) ⇒ Authentication

Returns a new instance of Authentication.



5
6
7
# File 'lib/ofx/authentication.rb', line 5

def initialize(client_id, client_secret)
  @client_id, @client_secret = client_id, client_secret
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/ofx/authentication.rb', line 3

def access_token
  @access_token
end

Instance Method Details

#auth_token_responseObject



13
14
15
# File 'lib/ofx/authentication.rb', line 13

def auth_token_response
  @auth_token_response ||= JSON.parse(RestClient::Request.execute(auth_request))
end

#get_access_tokenObject



9
10
11
# File 'lib/ofx/authentication.rb', line 9

def get_access_token
  @access_token ||= auth_token_response["access_token"]
end