Class: Persona::Client

Inherits:
Object
  • Object
show all
Includes:
Actions::Inquiries
Defined in:
lib/persona-ruby/client.rb

Constant Summary collapse

BASE_URL =
"https://withpersona.com/api/v1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Actions::Inquiries

#inquiry_create, #inquiry_delete, #inquiry_get, #inquiry_list, #inquiry_one_time_link, #inquiry_update

Constructor Details

#initialize(access_token:) ⇒ Client

Returns a new instance of Client.



10
11
12
13
# File 'lib/persona-ruby/client.rb', line 10

def initialize(access_token:)
  @access_token = "Bearer #{access_token}"
  @url = BASE_URL
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/persona-ruby/client.rb', line 6

def url
  @url
end

Instance Method Details

#connectionObject



15
16
17
# File 'lib/persona-ruby/client.rb', line 15

def connection
  Connection.new(@url, @access_token)
end