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.
- #inspect ⇒ Object
-
#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,
96 97 98 |
# File 'lib/weeb/data.rb', line 96 def account @account end |
#hidden ⇒ true, false (readonly) Also known as:
89 90 91 |
# File 'lib/weeb/data.rb', line 89 def hidden @hidden end |
#mime_type ⇒ String (readonly)
83 84 85 |
# File 'lib/weeb/data.rb', line 83 def mime_type @mime_type end |
#nsfw ⇒ true, false (readonly) Also known as: nsfw?
79 80 81 |
# File 'lib/weeb/data.rb', line 79 def nsfw @nsfw end |
#source ⇒ String? (readonly)
93 94 95 |
# File 'lib/weeb/data.rb', line 93 def source @source end |
#tags ⇒ Array<String> (readonly)
86 87 88 |
# File 'lib/weeb/data.rb', line 86 def end |
Instance Method Details
#add_tag(tag) ⇒ Object
Add a tag to the image
130 131 132 |
# File 'lib/weeb/data.rb', line 130 def add_tag(tag) @interface.(self, [tag]) end |
#add_tags(tags) ⇒ Object
Add tags to the image
118 119 120 |
# File 'lib/weeb/data.rb', line 118 def () @interface.(self, ) end |
#delete ⇒ Object Also known as: remove
Delete this image
141 142 143 |
# File 'lib/weeb/data.rb', line 141 def delete() @interface.delete_image(self) end |
#inspect ⇒ Object
146 147 148 |
# File 'lib/weeb/data.rb', line 146 def inspect "#<WeebSh::WeebImage @url=#{@url.inspect} @type=#{@type.inspect} @nsfw=#{@nsfw.inspect}>" end |
#remove_tag(tag) ⇒ Object
Remove a tag to the image
136 137 138 |
# File 'lib/weeb/data.rb', line 136 def remove_tag(tag) @interface.(self, [tag]) end |
#remove_tags(tags) ⇒ Object
Remove tags from the image
124 125 126 |
# File 'lib/weeb/data.rb', line 124 def () @interface.(self, ) end |