Class: Clicksign::Envelope

Inherits:
Base
  • Object
show all
Defined in:
lib/clicksign/envelope.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

api_url, build_data, headers, parse, request

Constructor Details

#initialize(envelope_key) ⇒ Envelope

Returns a new instance of Envelope.



14
15
16
# File 'lib/clicksign/envelope.rb', line 14

def initialize(envelope_key)
  @envelope_key = envelope_key
end

Class Method Details

.create(params = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/clicksign/envelope.rb', line 7

def self.create params={}
  request :post,
    api_url(model_name),
    build_data(params, model_name),
    {}
end

.model_nameObject



3
4
5
# File 'lib/clicksign/envelope.rb', line 3

def self.model_name
  'envelopes'
end

Instance Method Details

#activate(params = { status: 'running' }) ⇒ Object



22
23
24
25
26
27
# File 'lib/clicksign/envelope.rb', line 22

def activate params={ status: 'running' }
  Base.request :patch,
    Base.api_url(model_name, @envelope_key),
    Base.build_data(params, model_name, @envelope_key),
    {}
end

#model_nameObject



18
19
20
# File 'lib/clicksign/envelope.rb', line 18

def model_name
  self.class.model_name
end