Class: Tinker::Webhook::Dto::InvoiceEventDataDto

Inherits:
Object
  • Object
show all
Defined in:
lib/tinker/webhook/dto/invoice_event_data_dto.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ InvoiceEventDataDto

Returns a new instance of InvoiceEventDataDto.



9
10
11
12
13
14
15
16
17
18
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 9

def initialize(data)
  @id = data['id']
  @status = data['status']
  @invoice_number = data['invoice_number'] || ''
  @amount = data['amount'].to_f
  @currency = data['currency']
  @subscription_id = data['subscription_id'] || ''
  @created_at = data['created_at'] || ''
  @paid_at = data['paid_at']
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def id
  @id
end

#invoice_numberObject (readonly)

Returns the value of attribute invoice_number.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def invoice_number
  @invoice_number
end

Returns the value of attribute paid_at.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def paid_at
  @paid_at
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def status
  @status
end

#subscription_idObject (readonly)

Returns the value of attribute subscription_id.



7
8
9
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 7

def subscription_id
  @subscription_id
end

Instance Method Details

#to_hashObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/tinker/webhook/dto/invoice_event_data_dto.rb', line 20

def to_hash
  {
    id: @id,
    status: @status,
    invoice_number: @invoice_number,
    amount: @amount,
    currency: @currency,
    subscription_id: @subscription_id,
    created_at: @created_at,
    paid_at: @paid_at
  }
end