Class: Simplify::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/simplify/authentication.rb

Overview

Holds Authentication information used when accessing the API

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})

    @public_key = options[:public_key]
    if @public_key == nil
        @public_key = Simplify::public_key
    end

    @private_key = options[:private_key]
    if private_key == nil
        @private_key = Simplify::private_key
    end

    @access_token = options[:access_token]
end

Instance Attribute Details

#access_tokenObject

OAuth token used to access the API.



40
41
42
# File 'lib/simplify/authentication.rb', line 40

def access_token
  @access_token
end

#private_keyObject

Private key used to access the API.



37
38
39
# File 'lib/simplify/authentication.rb', line 37

def private_key
  @private_key
end

#public_keyObject

Public key used to access the API.



34
35
36
# File 'lib/simplify/authentication.rb', line 34

def public_key
  @public_key
end