Class: Unit::Customer::ArchiveCustomerRequest
- Inherits:
-
Object
- Object
- Unit::Customer::ArchiveCustomerRequest
- Defined in:
- lib/unit/models/customer/archive_customer_request.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(customer_id, reason = nil) ⇒ ArchiveCustomerRequest
constructor
A new instance of ArchiveCustomerRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, reason = nil) ⇒ ArchiveCustomerRequest
Returns a new instance of ArchiveCustomerRequest.
12 13 14 15 |
# File 'lib/unit/models/customer/archive_customer_request.rb', line 12 def initialize(customer_id, reason = nil) @customer_id = customer_id @reason = reason end |
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/customer/archive_customer_request.rb', line 8 def customer_id @customer_id end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
8 9 10 |
# File 'lib/unit/models/customer/archive_customer_request.rb', line 8 def reason @reason end |
Instance Method Details
#to_json_api ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/unit/models/customer/archive_customer_request.rb', line 17 def to_json_api payload = { data: { type: "archiveCustomer", attributes: { reason: reason } } } payload[:data][:attributes].compact! payload.to_json end |