Class: MaxApiClient::ImageAttachment
- Inherits:
-
Attachment
- Object
- Attachment
- MaxApiClient::ImageAttachment
- Defined in:
- lib/max_api_client/attachments.rb,
sig/max_api_client.rbs
Overview
Attachment wrapper for uploaded or remote images.
Instance Attribute Summary collapse
-
#photos ⇒ Object
readonly
Returns the value of attribute photos.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(token: nil, photos: nil, url: nil) ⇒ ImageAttachment
constructor
A new instance of ImageAttachment.
- #payload ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(token: nil, photos: nil, url: nil) ⇒ ImageAttachment
Returns a new instance of ImageAttachment.
29 30 31 32 33 |
# File 'lib/max_api_client/attachments.rb', line 29 def initialize(token: nil, photos: nil, url: nil) super(token:) @photos = photos @url = url end |
Instance Attribute Details
#photos ⇒ Object (readonly)
Returns the value of attribute photos.
27 28 29 |
# File 'lib/max_api_client/attachments.rb', line 27 def photos @photos end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
27 28 29 |
# File 'lib/max_api_client/attachments.rb', line 27 def url @url end |
Instance Method Details
#payload ⇒ Object
35 36 37 38 39 40 |
# File 'lib/max_api_client/attachments.rb', line 35 def payload return { token: token } if token return { url: url } if url { photos: photos } end |
#to_h ⇒ Object
42 43 44 |
# File 'lib/max_api_client/attachments.rb', line 42 def to_h { type: "image", payload: } end |