Class: HelloSign::Client

Inherits:
Object
  • Object
show all
Includes:
Proxy
Defined in:
lib/hello_sign/client.rb

Constant Summary collapse

API_ENDPOINT =
'https://api.hellosign.com'
API_VERSION =
'/v3'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Proxy

#account, #reusable_form, #signature_request, #team, #unclaimed_draft

Constructor Details

#initialize(email_address_or_hash, password = nil) ⇒ Client

Returns a new instance of Client.



15
16
17
18
19
20
21
22
23
# File 'lib/hello_sign/client.rb', line 15

def initialize(email_address_or_hash, password = nil)
  if email_address_or_hash.is_a? Hash
    @email_address = email_address_or_hash.fetch(:email_address) { raise ArgumentError }
    @password      = email_address_or_hash.fetch(:password) { raise ArgumentError }
  else
    @email_address = email_address_or_hash
    @password      = password
  end
end

Instance Attribute Details

#email_addressObject (readonly)

Returns the value of attribute email_address.



13
14
15
# File 'lib/hello_sign/client.rb', line 13

def email_address
  @email_address
end

#passwordObject (readonly)

Returns the value of attribute password.



13
14
15
# File 'lib/hello_sign/client.rb', line 13

def password
  @password
end

Instance Method Details

#get(path, options = {}) ⇒ Object



25
26
27
# File 'lib/hello_sign/client.rb', line 25

def get(path, options = {})
  request(:get, path, options)
end

#post(path, options = {}) ⇒ Object



29
30
31
# File 'lib/hello_sign/client.rb', line 29

def post(path, options = {})
  request(:post, path, options)
end