Class: PassaporteWeb::Configuration
- Inherits:
-
Object
- Object
- PassaporteWeb::Configuration
- Defined in:
- lib/passaporte_web/configuration.rb
Instance Attribute Summary collapse
-
#application_secret ⇒ Object
Returns the value of attribute application_secret.
-
#application_token ⇒ Object
Returns the value of attribute application_token.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#user_token ⇒ Object
Returns the value of attribute user_token.
Instance Method Summary collapse
- #application_credentials ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #user_credentials ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_secret ⇒ Object
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_token ⇒ Object
Returns the value of attribute application_token.
6 7 8 |
# File 'lib/passaporte_web/configuration.rb', line 6 def application_token @application_token end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/passaporte_web/configuration.rb', line 6 def url @url end |
#user_agent ⇒ Object
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_token ⇒ Object
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_credentials ⇒ Object
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_credentials ⇒ Object
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 |