Class: PassaporteWeb::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/passaporte_web/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
12
13
14
# File 'lib/passaporte_web/configuration.rb', line 8

def initialize
  @url = 'https://app.passaporteweb.com.br'
  @user_agent = "PassaporteWeb Ruby Client v#{PassaporteWeb::VERSION}"
  @application_token = nil
  @application_secret = nil
  @user_token = nil
end

Instance Attribute Details

#application_secretObject

Returns the value of attribute application_secret.



6
7
8
# File 'lib/passaporte_web/configuration.rb', line 6

def application_secret
  @application_secret
end

#application_tokenObject

Returns the value of attribute application_token.



6
7
8
# File 'lib/passaporte_web/configuration.rb', line 6

def application_token
  @application_token
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/passaporte_web/configuration.rb', line 6

def url
  @url
end

#user_agentObject

Returns the value of attribute user_agent.



6
7
8
# File 'lib/passaporte_web/configuration.rb', line 6

def user_agent
  @user_agent
end

#user_tokenObject

Returns the value of attribute user_token.



6
7
8
# File 'lib/passaporte_web/configuration.rb', line 6

def user_token
  @user_token
end

Instance Method Details

#application_credentialsObject



16
17
18
19
# File 'lib/passaporte_web/configuration.rb', line 16

def application_credentials
  check_tokens! :application_token, :application_secret
  base64_credential('application', @application_token, @application_secret)
end

#user_credentialsObject



21
22
23
24
# File 'lib/passaporte_web/configuration.rb', line 21

def user_credentials
  check_tokens! :user_token
  base64_credential('user', @user_token)
end