Debian Codegraph @

plugin/mastodon/model/attachment.rb

raw symbols SCIP
1 module Plugin::Mastodon
2 class AttachmentMeta < Diva::Model
3 #register :mastodon_attachment_meta, name: "Mastodon添付メディア メタ情報(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 #register :mastodon_attachment_meta, name: "Mastodon添付メディア メタ情報セット(Mastodon)"
13
14 field.has :original, AttachmentMeta
15 field.has :small, AttachmentMeta
16 end
17
18 # https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#attachment
19 class Attachment < Diva::Model
20 #register :mastodon_attachment, name: "Mastodon添付メディア(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