Class: Unit::Application::PatchApplicationRequest
- Inherits:
-
Object
- Object
- Unit::Application::PatchApplicationRequest
- Defined in:
- lib/unit/models/application/patch_application_request.rb
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(application_id, type, tags = nil) ⇒ PatchApplicationRequest
constructor
A new instance of PatchApplicationRequest.
-
#to_json_api ⇒ String
The JSON API payload.
Constructor Details
#initialize(application_id, type, tags = nil) ⇒ PatchApplicationRequest
Returns a new instance of PatchApplicationRequest.
14 15 16 17 18 |
# File 'lib/unit/models/application/patch_application_request.rb', line 14 def initialize(application_id, type, = nil) @application_id = application_id @type = type @tags = end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
9 10 11 |
# File 'lib/unit/models/application/patch_application_request.rb', line 9 def application_id @application_id end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
9 10 11 |
# File 'lib/unit/models/application/patch_application_request.rb', line 9 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/unit/models/application/patch_application_request.rb', line 9 def type @type end |
Instance Method Details
#to_json_api ⇒ String
Returns The JSON API payload.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/unit/models/application/patch_application_request.rb', line 21 def to_json_api payload = { data: { type: type, attributes: { tags: } } } payload[:data][:attributes].compact! payload.to_json end |