Class: HelloSign::Proxy::SignatureRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/hello_sign/proxy/signature_request.rb

Constant Summary

Constants inherited from Object

Object::DEFAULT_PAGE

Instance Method Summary collapse

Constructor Details

#initialize(client, request_id) ⇒ SignatureRequest

Returns a new instance of SignatureRequest.



9
10
11
12
13
# File 'lib/hello_sign/proxy/signature_request.rb', line 9

def initialize(client, request_id)
  super(client)

  @request_id = request_id
end

Instance Method Details

#cancelObject



47
48
49
# File 'lib/hello_sign/proxy/signature_request.rb', line 47

def cancel
  @client.post("/signature_request/cancel/#@request_id")
end

#create_embedded_request(params = {}, &block) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/hello_sign/proxy/signature_request.rb', line 23

def create_embedded_request(params = {}, &block)
  if (form_id = params[:form])
    deliver_embedded_request_with_form(form_id, &block)
  else
    deliver_embedded_request(&block)
  end
end

#deliver(params = {}, &block) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/hello_sign/proxy/signature_request.rb', line 15

def deliver(params = {}, &block)
  if (form_id = params[:form])
    deliver_request_with_form(form_id, &block)
  else
    deliver_request(&block)
  end
end

#final_copyObject



51
52
53
# File 'lib/hello_sign/proxy/signature_request.rb', line 51

def final_copy
  @client.get("/signature_request/final_copy/#@request_id")
end

#list(params = {}) ⇒ Object



35
36
37
38
39
# File 'lib/hello_sign/proxy/signature_request.rb', line 35

def list(params = {})
  @client.get('/signature_request/list', {
    params: {page: DEFAULT_PAGE}.merge(params)
  })
end

#remind(params = {}) ⇒ Object



41
42
43
44
45
# File 'lib/hello_sign/proxy/signature_request.rb', line 41

def remind(params = {})
  @client.post("/signature_request/remind/#@request_id", {
    body: {email_address: params.delete(:email)}.merge(params)
  })
end

#statusObject



31
32
33
# File 'lib/hello_sign/proxy/signature_request.rb', line 31

def status
  @client.get("/signature_request/#@request_id")
end

#temporary_signature_url(signature_id) ⇒ Object



55
56
57
# File 'lib/hello_sign/proxy/signature_request.rb', line 55

def temporary_signature_url(signature_id)
  @client.get("/embedded/sign_url/#{signature_id}")
end