Class: NagaApiClient
- Inherits:
-
Object
- Object
- NagaApiClient
- Defined in:
- lib/minitest/naga/naga_api_client.rb
Constant Summary collapse
- @@BASE_URL =
@@BASE_URL = “localhost:3000/api/v1/”
"https://naga-unit-testing.herokuapp.com/api/v1/"
- @@FILE_PATH =
File.join(Dir.home, ".minitest_naga")
Instance Attribute Summary collapse
-
#authentication_token ⇒ Object
readonly
Returns the value of attribute authentication_token.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Class Method Summary collapse
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
-
#initialize ⇒ NagaApiClient
constructor
A new instance of NagaApiClient.
Constructor Details
#initialize ⇒ NagaApiClient
Returns a new instance of NagaApiClient.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/minitest/naga/naga_api_client.rb', line 10 def initialize @options = { headers: { "Content-Type" => "application/x-www-form-urlencoded" } } @authenticated = false if File.file?(@@FILE_PATH) @credentials = eval(File.read(@@FILE_PATH)) validate(@credentials) else authenticate end end |
Instance Attribute Details
#authentication_token ⇒ Object (readonly)
Returns the value of attribute authentication_token.
8 9 10 |
# File 'lib/minitest/naga/naga_api_client.rb', line 8 def authentication_token @authentication_token end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/minitest/naga/naga_api_client.rb', line 6 def credentials @credentials end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/minitest/naga/naga_api_client.rb', line 7 def email @email end |
Class Method Details
.BASE_URL ⇒ Object
21 22 23 |
# File 'lib/minitest/naga/naga_api_client.rb', line 21 def self.BASE_URL @@BASE_URL end |
.FILE_PATH ⇒ Object
25 26 27 |
# File 'lib/minitest/naga/naga_api_client.rb', line 25 def self.FILE_PATH @@FILE_PATH end |
Instance Method Details
#authenticated? ⇒ Boolean
33 34 35 |
# File 'lib/minitest/naga/naga_api_client.rb', line 33 def authenticated? @authenticated end |