Skip to content

Commit 1a61423

Browse files
authored
Fixes and suggestions from PR #7 (#8)
* Update README.md * Update payload.rb
1 parent 6919b9a commit 1a61423

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ pix = QrcodePixRuby::Payload.new(
4949
repeatable: false
5050
)
5151

52+
# If needed, change the attributes value later
53+
pix.pix_key = 'minhaoutrachavepix'
54+
pix.merchant_city = 'BRASILIA'
55+
5256
# QRCode copia-e-cola
5357
puts pix.payload
5458

55-
# QRCode para uso em imagens
59+
# QRCode for images
5660
puts pix.base64
5761
```
5862

@@ -70,6 +74,10 @@ pix = QrcodePixRuby::Payload.new(
7074
repeatable: false
7175
)
7276

77+
# If needed, change the attributes value later
78+
pix.url = 'https://another-example.com'
79+
pix.amount = 1.50
80+
7381
# QRCode copia-e-cola
7482
puts pix.payload
7583

lib/qrcode_pix_ruby/payload.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ def base64
7171
private
7272

7373
def verify_kwargs(keys)
74-
unknows = keys - ATTRIBUTES
74+
unknowns = keys - ATTRIBUTES
7575

76-
return unless unknows.any?
76+
return unless unknowns.any?
7777

78-
raise QrcodePixRuby::PayloadArgumentError, "Unknown attributes: #{unknows.join(', ')}"
78+
raise QrcodePixRuby::PayloadArgumentError, "Unknown attributes: #{unknowns.join(', ')}"
7979
end
8080

8181
def emv(id, value)

0 commit comments

Comments
 (0)