Class: ItunesReceiptDecoder::Decode::Base
- Inherits:
-
Object
- Object
- ItunesReceiptDecoder::Decode::Base
- Defined in:
- lib/itunes_receipt_decoder/decode/base.rb
Overview
ItunesReceiptDecoder::Decode::Base
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
The raw receipt, i.e.
-
#raw_receipt ⇒ Object
readonly
The raw receipt, i.e.
Instance Method Summary collapse
-
#initialize(raw_receipt, options = {}) ⇒ Base
constructor
Initializes with a raw (base64 decoded receipt).
-
#production? ⇒ Boolean
Returns true if the receipt is created in the Production environment.
-
#receipt ⇒ Object
Returns the receipt receipt properties.
-
#sandbox? ⇒ Boolean
Returns true if the receipt is
notcreated in Production.
Constructor Details
#initialize(raw_receipt, options = {}) ⇒ Base
Initializes with a raw (base64 decoded receipt)
Arguments
-
raw_receipt- the raw receipt, i.e. not base64 encoded
20 21 22 23 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 20 def initialize(raw_receipt, = {}) @raw_receipt = raw_receipt = end |
Instance Attribute Details
#options ⇒ Object (readonly)
The raw receipt, i.e. not base64 encoded
12 13 14 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 12 def end |
#raw_receipt ⇒ Object (readonly)
The raw receipt, i.e. not base64 encoded
12 13 14 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 12 def raw_receipt @raw_receipt end |
Instance Method Details
#production? ⇒ Boolean
Returns true if the receipt is created in the Production environment
33 34 35 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 33 def production? environment == 'Production' end |
#receipt ⇒ Object
Returns the receipt receipt properties
27 28 29 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 27 def receipt decode && @receipt end |
#sandbox? ⇒ Boolean
Returns true if the receipt is not created in Production
39 40 41 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 39 def sandbox? !production? end |