Class: Tinycert::Client
- Inherits:
-
Object
- Object
- Tinycert::Client
- Defined in:
- lib/tinycert/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#passphrase ⇒ Object
readonly
Returns the value of attribute passphrase.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #authorities ⇒ Object
- #connect ⇒ Object
- #disconnect ⇒ Object
-
#initialize(email, passphrase, api_key) ⇒ Client
constructor
A new instance of Client.
- #request(url, params) ⇒ Object
- #session_request(url, params) ⇒ Object
Constructor Details
#initialize(email, passphrase, api_key) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 |
# File 'lib/tinycert/client.rb', line 5 def initialize email, passphrase, api_key @email = email @passphrase = passphrase @api_key = api_key @token = nil end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/tinycert/client.rb', line 3 def api_key @api_key end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/tinycert/client.rb', line 3 def email @email end |
#passphrase ⇒ Object (readonly)
Returns the value of attribute passphrase.
3 4 5 |
# File 'lib/tinycert/client.rb', line 3 def passphrase @passphrase end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/tinycert/client.rb', line 3 def token @token end |
Instance Method Details
#authorities ⇒ Object
26 27 28 |
# File 'lib/tinycert/client.rb', line 26 def Tinycert::CertAuthorities.new(self) end |
#connect ⇒ Object
12 13 14 15 |
# File 'lib/tinycert/client.rb', line 12 def connect request = request 'https://www.tinycert.org/api/v1/connect', { email: email, passphrase: passphrase } @token = request.results['token'] end |
#disconnect ⇒ Object
30 31 |
# File 'lib/tinycert/client.rb', line 30 def disconnect end |