Class: AppleReceipt::Receipt
- Inherits:
-
Object
- Object
- AppleReceipt::Receipt
- Defined in:
- lib/apple_receipt/receipt.rb
Overview
Receipt represents an Apple receipt.
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(raw_receipt) ⇒ Receipt
constructor
A new instance of Receipt.
- #purchase_info ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(raw_receipt) ⇒ Receipt
Returns a new instance of Receipt.
12 13 14 15 16 17 18 |
# File 'lib/apple_receipt/receipt.rb', line 12 def initialize(raw_receipt) receipt_decoded = Base64.decode64(raw_receipt) @version, @signature, @certificate, @data = ReceiptParser.parse(receipt_decoded) end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
28 29 30 |
# File 'lib/apple_receipt/receipt.rb', line 28 def certificate @certificate end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
28 29 30 |
# File 'lib/apple_receipt/receipt.rb', line 28 def data @data end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
28 29 30 |
# File 'lib/apple_receipt/receipt.rb', line 28 def signature @signature end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
28 29 30 |
# File 'lib/apple_receipt/receipt.rb', line 28 def version @version end |
Instance Method Details
#purchase_info ⇒ Object
20 21 22 |
# File 'lib/apple_receipt/receipt.rb', line 20 def purchase_info @purchase_info ||= NextStepParser.parse(data) end |