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
-
#environment ⇒ Object
readonly
The raw receipt, i.e.
-
#options ⇒ Object
readonly
The raw receipt, i.e.
-
#raw_receipt ⇒ Object
readonly
The raw receipt, i.e.
-
#receipt ⇒ Object
readonly
The raw receipt, i.e.
-
#style ⇒ 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.
-
#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 24 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 20 def initialize(raw_receipt, = {}) @raw_receipt = raw_receipt @options = decode end |
Instance Attribute Details
#environment ⇒ Object (readonly)
The raw receipt, i.e. not base64 encoded
12 13 14 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 12 def environment @environment end |
#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 @options 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 |
#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 receipt @receipt end |
#style ⇒ Object (readonly)
The raw receipt, i.e. not base64 encoded
12 13 14 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 12 def style @style end |
Instance Method Details
#production? ⇒ Boolean
Returns true if the receipt is created in the Production environment
28 29 30 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 28 def production? environment == 'Production' end |
#sandbox? ⇒ Boolean
Returns true if the receipt is not created in Production
34 35 36 |
# File 'lib/itunes_receipt_decoder/decode/base.rb', line 34 def sandbox? !production? end |