Class: Tinker::Webhook::Dto::InvoiceEventDataDto
- Inherits:
-
Object
- Object
- Tinker::Webhook::Dto::InvoiceEventDataDto
- Defined in:
- lib/tinker/webhook/dto/invoice_event_data_dto.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#invoice_number ⇒ Object
readonly
Returns the value of attribute invoice_number.
-
#paid_at ⇒ Object
readonly
Returns the value of attribute paid_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subscription_id ⇒ Object
readonly
Returns the value of attribute subscription_id.
Instance Method Summary collapse
-
#initialize(data) ⇒ InvoiceEventDataDto
constructor
A new instance of InvoiceEventDataDto.
- #to_hash ⇒ Object
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
#amount ⇒ Object (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_at ⇒ Object (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 |
#currency ⇒ Object (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 |
#id ⇒ Object (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_number ⇒ Object (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 |
#paid_at ⇒ Object (readonly)
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 |
#status ⇒ Object (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_id ⇒ Object (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_hash ⇒ Object
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 |