receipts 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/receipts/receipt.rb +7 -2
- data/lib/receipts/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42fd5e58ab95cd832a64807adf73afa1e9756316190dbe4819d0d0c634875c01
|
4
|
+
data.tar.gz: 1295e9bc817000ef60a9b63112429716febd07e316d07cd8da164d4771622952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3bbc34ddee5fef59da9cbc2f5a8107a5ee1635a23e77241b42ac9e2f0d7a844db3a19e78603865e62be7adc58442c89e5ff0dc483bb1807e9113dd885acd330
|
7
|
+
data.tar.gz: 9ee6b9e94669033b9a21a3fb9c064353ce2e24881caf5b5964a6639f3daf88df52b25ce054dabbd9c84b670615eb981e1684cd8c03c3139ac395b6d30d2143da
|
data/lib/receipts/receipt.rb
CHANGED
@@ -3,7 +3,7 @@ require 'prawn/table'
|
|
3
3
|
|
4
4
|
module Receipts
|
5
5
|
class Receipt < Prawn::Document
|
6
|
-
attr_reader :attributes, :id, :company, :custom_font, :line_items, :logo, :message, :product
|
6
|
+
attr_reader :attributes, :id, :company, :custom_font, :line_items, :logo, :message, :product, :subheading
|
7
7
|
|
8
8
|
def initialize(attributes)
|
9
9
|
@attributes = attributes
|
@@ -12,6 +12,7 @@ module Receipts
|
|
12
12
|
@line_items = attributes.fetch(:line_items)
|
13
13
|
@custom_font = attributes.fetch(:font, {})
|
14
14
|
@message = attributes.fetch(:message) { default_message }
|
15
|
+
@subheading = attributes.fetch(:subheading) { default_subheading }
|
15
16
|
|
16
17
|
super(margin: 0)
|
17
18
|
|
@@ -25,6 +26,10 @@ module Receipts
|
|
25
26
|
"We've received your payment for #{attributes.fetch(:product)}. You can keep this receipt for your records. For questions, contact us anytime at <color rgb='326d92'><link href='mailto:#{company.fetch(:email)}?subject=Charge ##{id}'><b>#{company.fetch(:email)}</b></link></color>."
|
26
27
|
end
|
27
28
|
|
29
|
+
def default_subheading
|
30
|
+
"RECEIPT FOR CHARGE #%{id}"
|
31
|
+
end
|
32
|
+
|
28
33
|
def setup_fonts
|
29
34
|
font_families.update "Primary" => custom_font
|
30
35
|
font "Primary"
|
@@ -50,7 +55,7 @@ module Receipts
|
|
50
55
|
end
|
51
56
|
|
52
57
|
move_down 8
|
53
|
-
text "<color rgb='a6a6a6'
|
58
|
+
text "<color rgb='a6a6a6'>#{subheading % { id: id }}</color>", inline_format: true
|
54
59
|
|
55
60
|
move_down 30
|
56
61
|
text message, inline_format: true, size: 12.5, leading: 4
|
data/lib/receipts/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: receipts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.6
|
143
|
+
rubygems_version: 2.7.6
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Receipts for your Rails application that works with any payment provider.
|