Module: Fortnox::API::ClassMethods
Instance Method Summary collapse
Instance Method Details
#get_access_token ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fortnox/api/class_methods.rb', line 9 def get_access_token repository = self.new repository.headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'Authorization-Code' => , 'Client-Secret' => get_client_secret, } response = repository.get('/') response[ 'Authorisation' ][ 'AccessToken' ] end |
#set_headers(headers = {}) ⇒ Object
24 25 26 |
# File 'lib/fortnox/api/class_methods.rb', line 24 def set_headers( headers = {} ) self.headers.merge!( headers ) end |