| 1 |
module Plugin::Mastodon |
| 2 |
class AttachmentMeta < Diva::Model |
| 3 |
タ情報(Mastodon)" |
| 4 |
|
| 5 |
field.int :width |
| 6 |
field.int :height |
| 7 |
field.string :size |
| 8 |
field.string :aspect |
| 9 |
end |
| 10 |
|
| 11 |
class AttachmentMetaSet < Diva::Model |
| 12 |
情報セット(Mastodon)" |
| 13 |
|
| 14 |
field.has :original, AttachmentMeta |
| 15 |
field.has :small, AttachmentMeta |
| 16 |
end |
| 17 |
|
| 18 |
|
| 19 |
class Attachment < Diva::Model |
| 20 |
ア(Mastodon)" |
| 21 |
|
| 22 |
field.string :id, required: true |
| 23 |
field.string :type, required: true |
| 24 |
field.uri :url |
| 25 |
field.uri :remote_url |
| 26 |
field.uri :preview_url, required: true |
| 27 |
field.uri :text_url |
| 28 |
field.string :description |
| 29 |
|
| 30 |
field.has :meta, AttachmentMetaSet |
| 31 |
|
| 32 |
def inspect |
| 33 |
"mastodon-attachment(#{remote_url})" |
| 34 |
end |
| 35 |
end |
| 36 |
end |