Class: RubyNative::IAP::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_native/iap/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, status:, owner_token:, product_id:, original_transaction_id:, transaction_id:, purchase_date:, expires_date:, environment:, notification_uuid:, success_path:) ⇒ Event

Returns a new instance of Event.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby_native/iap/event.rb', line 9

def initialize(type:, status:, owner_token:, product_id:, original_transaction_id:,
               transaction_id:, purchase_date:, expires_date:, environment:,
               notification_uuid:, success_path:)
  @type = type
  @status = status
  @owner_token = owner_token
  @product_id = product_id
  @original_transaction_id = original_transaction_id
  @transaction_id = transaction_id
  @purchase_date = purchase_date
  @expires_date = expires_date
  @environment = environment
  @notification_uuid = notification_uuid
  @success_path = success_path
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def environment
  @environment
end

#expires_dateObject (readonly)

Returns the value of attribute expires_date.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def expires_date
  @expires_date
end

#notification_uuidObject (readonly)

Returns the value of attribute notification_uuid.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def notification_uuid
  @notification_uuid
end

#original_transaction_idObject (readonly)

Returns the value of attribute original_transaction_id.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def original_transaction_id
  @original_transaction_id
end

#owner_tokenObject (readonly)

Returns the value of attribute owner_token.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def owner_token
  @owner_token
end

#product_idObject (readonly)

Returns the value of attribute product_id.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def product_id
  @product_id
end

#purchase_dateObject (readonly)

Returns the value of attribute purchase_date.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def purchase_date
  @purchase_date
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def status
  @status
end

#success_pathObject (readonly)

Returns the value of attribute success_path.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def success_path
  @success_path
end

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def transaction_id
  @transaction_id
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/ruby_native/iap/event.rb', line 4

def type
  @type
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ruby_native/iap/event.rb', line 25

def active?
  status == "active"
end

#canceled?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/ruby_native/iap/event.rb', line 37

def canceled?
  type == "subscription.canceled"
end

#created?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/ruby_native/iap/event.rb', line 33

def created?
  type == "subscription.created"
end

#expired?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/ruby_native/iap/event.rb', line 29

def expired?
  status == "expired"
end