Class: Simplify::Authentication
- Inherits:
-
Object
- Object
- Simplify::Authentication
- Defined in:
- lib/simplify/authentication.rb
Overview
Holds Authentication information used when accessing the API
Instance Attribute Summary collapse
-
#access_token ⇒ Object
OAuth token used to access the API.
-
#private_key ⇒ Object
Private key used to access the API.
-
#public_key ⇒ Object
Public key used to access the API.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Authentication
constructor
Creates an Authentication object.
Constructor Details
#initialize(options = {}) ⇒ Authentication
Creates an Authentication object.
- options
-
hash containing information to initialise the object. Valid options are :public_key, :private_key and :access_token.
If no value for public_key is passed or the value is nil then Simplify::public_key is used. If no value for private_key is passed or the value is nil then Simplify::private_key is used.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/simplify/authentication.rb', line 48 def initialize( = {}) @public_key = [:public_key] if @public_key == nil @public_key = Simplify::public_key end @private_key = [:private_key] if private_key == nil @private_key = Simplify::private_key end @access_token = [:access_token] end |
Instance Attribute Details
#access_token ⇒ Object
OAuth token used to access the API.
40 41 42 |
# File 'lib/simplify/authentication.rb', line 40 def access_token @access_token end |
#private_key ⇒ Object
Private key used to access the API.
37 38 39 |
# File 'lib/simplify/authentication.rb', line 37 def private_key @private_key end |
#public_key ⇒ Object
Public key used to access the API.
34 35 36 |
# File 'lib/simplify/authentication.rb', line 34 def public_key @public_key end |