Class: Signnow::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/signnow/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token = nil) ⇒ Client

Creates an account object using the given Signnow user. existing account.

Parameters:

  • User (String)

    access token to use the signnow api.



9
10
11
12
# File 'lib/signnow/client.rb', line 9

def initialize(access_token=nil)
  @access_token = access_token
  self
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



3
4
5
# File 'lib/signnow/client.rb', line 3

def access_token
  @access_token
end

Instance Method Details

#perform!(&block) ⇒ Object

Executes block with the access token

client = Signnow::Client.new(‘user_auth’) client.perform! do |access_token|

Signnow::User.show(access_token: access_token)

end

Examples:

description

Parameters:

  • block (block)

    to execute

Raises:



23
24
25
26
# File 'lib/signnow/client.rb', line 23

def perform!(&block)
  raise Signnow::AuthenticationError unless access_token
  block.call(access_token)
end