ish_models 0.0.33.298 → 0.0.33.299

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6efbb3c5c1034605f73ba6a4f56764e19fade25ba178072bcbdaf6527bcee7f4
4
- data.tar.gz: aede88c5c6e113884d13f5b8bdeb243509d5cc824d3decbe4a3bf16384900cd1
3
+ metadata.gz: fa44087f500e7920ced4feaf0beb2374ec5cc3a022b64c37b8543c6437ebb2b8
4
+ data.tar.gz: 1ec1b0bd08816c041822cd8633015f88084f02dc2cdb846ea8b9e5b99331560b
5
5
  SHA512:
6
- metadata.gz: 570ceaa54fada7bf9740eb8e7a0101b56942d1c0d65e59e35199ba42e9e3891a5ba8456d47e1eadc56e54488fd3584f0c854b72aa9b4d2e8cb33812fe6052f08
7
- data.tar.gz: a54d2878d3b3e90a1d891d7485c18ca6f884fb32f46a47f13052eeea959aceebc129edc28ac3022cab0299a4cc9cfd87989a3081a99e87ee92aca1148962c86b
6
+ metadata.gz: 1343879402cbe9523d920f87ba9a12b39c7a5e9438d14383ef9cb08b2022dd4b4ef75f5da6104fea82cf8015e757e04685ec49bfb8f5d11c0fae1c45400dd452
7
+ data.tar.gz: 955585c6273244c0b72880213d9edbbeee90050f48f1260183c3e9e0a04fa3303247625477eea1afdf09116405f7aa08190adcf2835b46e72efce4b486576282
data/lib/ish_models.rb CHANGED
@@ -66,6 +66,7 @@ require 'video'
66
66
  require 'office/action'
67
67
  require 'office/action_tie'
68
68
  require 'office/admin_message'
69
+ require 'office/directmail_envelope'
69
70
  require 'office/email_action'
70
71
  require 'office/email_action_tie'
71
72
  require 'office/email_attachment'
@@ -80,6 +81,7 @@ require 'office/lead_action_template'
80
81
  require 'office/obfuscated_redirect'
81
82
  require 'office/scheduled_email_action'
82
83
 
84
+
83
85
  require 'wco/appliance'
84
86
  require 'wco/appliance_tmpl'
85
87
  require 'wco/leadset'
@@ -0,0 +1,51 @@
1
+ require 'prawn'
2
+
3
+ class Office::DirectmailEnvelope
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+
8
+ ## 72 points per inch
9
+ ## 72 ppi
10
+ def self.list_to_envelopes props
11
+ from = props[:from]
12
+
13
+ pdf = Prawn::Document.new({ page_size: [ 9.5*72, 4.12*72 ], :margin => [0,0,0,0] })
14
+
15
+ pdf.canvas do
16
+
17
+ props[:tos].each_with_index do |to, idx|
18
+ print '.'
19
+
20
+ pdf.bounding_box( [ 0.5*72, 3.5*72 ], width: 3*72, height: 2*72 ) do
21
+ # pdf.transparent(0.5) { pdf.stroke_bounds }
22
+
23
+ pdf.text from[:name]
24
+ pdf.text from[:address_1]
25
+ pdf.text from[:address_2]
26
+ pdf.text from[:address_3]
27
+ end
28
+
29
+ pdf.bounding_box( [ 4*72, 2.5*72 ], width: 4*72, height: 2*72 ) do
30
+ # pdf.transparent(0.5) { pdf.stroke_bounds }
31
+
32
+ pdf.text to[:name]
33
+ pdf.text to[:address_1]
34
+ pdf.text to[:address_2]
35
+ pdf.text to[:address_3]
36
+ end
37
+
38
+ if idx+1 != props[:tos].length
39
+ pdf.start_new_page
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+
46
+ return pdf
47
+ end
48
+
49
+ end
50
+ ODE = ::Office::DirectmailEnvelope
51
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.298
4
+ version: 0.0.33.299
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -216,6 +216,7 @@ files:
216
216
  - lib/office/action.rb
217
217
  - lib/office/action_tie.rb
218
218
  - lib/office/admin_message.rb
219
+ - lib/office/directmail_envelope.rb
219
220
  - lib/office/email_action.rb
220
221
  - lib/office/email_action_tie.rb
221
222
  - lib/office/email_attachment.rb