receipts 0.2.1 → 0.2.2

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
- SHA1:
3
- metadata.gz: 836ad2c3d8ef165d02044062b75480001c0d47be
4
- data.tar.gz: bf469767b7ff2ae9474e582afaa2ba779ecd0c3b
2
+ SHA256:
3
+ metadata.gz: 42fd5e58ab95cd832a64807adf73afa1e9756316190dbe4819d0d0c634875c01
4
+ data.tar.gz: 1295e9bc817000ef60a9b63112429716febd07e316d07cd8da164d4771622952
5
5
  SHA512:
6
- metadata.gz: 4161caf02778cc38de6deae6dd48a7c1ba62d009586d328ee2f1077fc743b3652f107d818c491d35ed144a9edb3853bc5bc374c5002eef252e02322f9a680b12
7
- data.tar.gz: ac61fb651dd4ad6a586ccc74820d334482257f0b819b4d8683b6dacc8395d7683917b2dae3935ca0ccd0ab2321ff6577fd7921f766c1ea6371ddd36484da8f07
6
+ metadata.gz: d3bbc34ddee5fef59da9cbc2f5a8107a5ee1635a23e77241b42ac9e2f0d7a844db3a19e78603865e62be7adc58442c89e5ff0dc483bb1807e9113dd885acd330
7
+ data.tar.gz: 9ee6b9e94669033b9a21a3fb9c064353ce2e24881caf5b5964a6639f3daf88df52b25ce054dabbd9c84b670615eb981e1684cd8c03c3139ac395b6d30d2143da
@@ -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'>RECEIPT FOR CHARGE ##{id}</color>", inline_format: true
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
@@ -1,3 +1,3 @@
1
1
  module Receipts
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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: 2017-08-29 00:00:00.000000000 Z
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.11
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.