Class: WeebSh::WeebImage
- Inherits:
-
PreviewImage
- Object
- PreviewImage
- WeebSh::WeebImage
- Defined in:
- lib/weeb/data.rb
Overview
Represents an image for toph
Instance Attribute Summary collapse
-
#account ⇒ String
(also: #uploader, #author)
readonly
The ID of the uploader.
-
#hidden ⇒ true, false
(also: #hidden?)
readonly
Whether or not this image can only be seen by the uploader.
-
#mime_type ⇒ String
readonly
The mime type of the image.
-
#nsfw ⇒ true, false
(also: #nsfw?)
readonly
Whether or not this image is nsfw.
-
#source ⇒ String?
readonly
The source of the image.
-
#tags ⇒ Array<String>
readonly
The tags on image.
Attributes inherited from PreviewImage
Attributes included from IDObject
Instance Method Summary collapse
-
#add_tag(tag) ⇒ Object
Add a tag to the image.
-
#add_tags(tags) ⇒ Object
Add tags to the image.
-
#delete ⇒ Object
(also: #remove)
Delete this image.
-
#remove_tag(tag) ⇒ Object
Remove a tag to the image.
-
#remove_tags(tags) ⇒ Object
Remove tags from the image.
Methods included from IDObject
Instance Attribute Details
#account ⇒ String (readonly) Also known as: uploader,
Returns the ID of the uploader.
99 100 101 |
# File 'lib/weeb/data.rb', line 99 def account @account end |
#hidden ⇒ true, false (readonly) Also known as:
Returns whether or not this image can only be seen by the uploader.
92 93 94 |
# File 'lib/weeb/data.rb', line 92 def hidden @hidden end |
#mime_type ⇒ String (readonly)
Returns the mime type of the image.
86 87 88 |
# File 'lib/weeb/data.rb', line 86 def mime_type @mime_type end |
#nsfw ⇒ true, false (readonly) Also known as: nsfw?
Returns whether or not this image is nsfw.
82 83 84 |
# File 'lib/weeb/data.rb', line 82 def nsfw @nsfw end |
#source ⇒ String? (readonly)
Returns the source of the image.
96 97 98 |
# File 'lib/weeb/data.rb', line 96 def source @source end |
#tags ⇒ Array<String> (readonly)
Returns the tags on image.
89 90 91 |
# File 'lib/weeb/data.rb', line 89 def end |
Instance Method Details
#add_tag(tag) ⇒ Object
Add a tag to the image
133 134 135 |
# File 'lib/weeb/data.rb', line 133 def add_tag(tag) @interface.(self, [tag]) end |
#add_tags(tags) ⇒ Object
Add tags to the image
121 122 123 |
# File 'lib/weeb/data.rb', line 121 def () @interface.(self, ) end |
#delete ⇒ Object Also known as: remove
Delete this image
144 145 146 |
# File 'lib/weeb/data.rb', line 144 def delete @interface.delete_image(self) end |
#remove_tag(tag) ⇒ Object
Remove a tag to the image
139 140 141 |
# File 'lib/weeb/data.rb', line 139 def remove_tag(tag) @interface.(self, [tag]) end |
#remove_tags(tags) ⇒ Object
Remove tags from the image
127 128 129 |
# File 'lib/weeb/data.rb', line 127 def () @interface.(self, ) end |