Class: Signnow::Client
- Inherits:
-
Object
- Object
- Signnow::Client
- Defined in:
- lib/signnow/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
-
#initialize(access_token = nil) ⇒ Client
constructor
Creates an account object using the given Signnow user.
-
#perform!(&block) ⇒ Object
Executes block with the access token.
Constructor Details
#initialize(access_token = nil) ⇒ Client
Creates an account object using the given Signnow user. existing account.
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_token ⇒ Object (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
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 |