Module: Signnow::Operations::All::ClassMethods

Defined in:
lib/signnow/operations/all.rb

Instance Method Summary collapse

Instance Method Details

#all(attributes = {}) ⇒ Array

Retrieves all available objects from the Signnow API

Parameters:

  • options (Hash)

    Options to pass to the API

Returns:

  • (Array)

    The available objects



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

def all(attributes = {})
  response = Signnow.request(:get, nil, api_all_url , attributes, options_for_all(attributes))
  results_from response
end

#options_for_all(attributes) ⇒ Hash

Options for all overwrite this in the model to set security

Returns:

  • (Hash)

Raises:



26
27
28
29
30
31
32
33
# File 'lib/signnow/operations/all.rb', line 26

def options_for_all(attributes)
  access_token = attributes.delete(:access_token)
  raise AuthenticationError unless access_token
  {
    auth_type: :user_token,
    auth_token: access_token
  }
end