legalizer 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,30 +40,32 @@ Sending is simplified right now, but will be enhanced later. For now you can jus
40
40
 
41
41
  template = legalizer.find.template(id)
42
42
 
43
- xml_request = '<template>
44
- <guid>a_956_1f68556eba674af0b5dc35cdeec58b38</guid>
43
+ package_id = template.package
44
+
45
+ xml_request = "<template>
46
+ <guid>#{package_id}</guid>
45
47
  <subject>Test Subject</subject>
46
48
  <description>Test Description</description>
47
49
  <action>prefill</action>
48
50
  <expires_in>5 days</expires_in>
49
51
  <roles>
50
- <role role_name="Employee Address">
52
+ <role role_name='Employee Address'>
51
53
  <name>John Employee</name>
52
54
  <email>john@employee.com</email>
53
55
  <locked>true</locked>
54
56
  </role>
55
- <role role_id="a_2313_lf79870f3dv_2">
57
+ <role role_id='a_2313_lf79870f3dv_2'>
56
58
  <name>Jane Employee</name>
57
59
  <email>jane@employee.com</email>
58
60
  <locked>true</locked>
59
61
  </role>
60
62
  </roles>
61
63
  <merge_fields>
62
- <merge_field merge_field_id="a_233_f309f82jklnm_232">
64
+ <merge_field merge_field_id='a_233_f309f82jklnm_232'>
63
65
  <value>$100 per hour</value>
64
66
  <locked>true</locked>
65
67
  </merge_field>
66
- <merge_field merge_field_name="Employee Name">
68
+ <merge_field merge_field_name='Employee Name'>
67
69
  <value>J. Employee</value>
68
70
  </merge_field>
69
71
  </merge_fields>
@@ -73,7 +75,7 @@ Sending is simplified right now, but will be enhanced later. For now you can jus
73
75
  </tag>
74
76
  </tags>
75
77
  <callback_location>http://localhost/doc_callback</callback_location>
76
- </template>'
78
+ </template>"
77
79
 
78
80
  template.send(xml_request)
79
81
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{legalizer}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darby Frey"]
12
- s.date = %q{2010-12-09}
12
+ s.date = %q{2010-12-10}
13
13
  s.description = %q{}
14
14
  s.email = %q{darbyfrey@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -5,10 +5,14 @@ module Legalizer
5
5
  @source = options[:object]
6
6
  end
7
7
 
8
- def send(request_xml)
8
+ # prepare a template for sending, return the guid of the prepared instance
9
+ def package
9
10
  template_guid = self.source["guid"]
10
11
  package = @config.connection.request(:get, "/api/templates/#{template_guid}/prepackage.json", @config.token, {})
11
- package_guid = JSON.parse(package.body)["template"]["guid"]
12
+ JSON.parse(package.body)["template"]["guid"]
13
+ end
14
+
15
+ def send(request_xml)
12
16
  response = JSON.parse(@config.connection.request(:post, '/api/templates.json', @config.token, {}, request_xml, { 'Content-Type' => 'application/xml' }).body)
13
17
  response["document"]["guid"]
14
18
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legalizer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darby Frey
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 -08:00
18
+ date: 2010-12-10 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency