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,
Returns the ID of the uploader.
95 96 97 |
# File 'lib/weeb/data.rb', line 95 def account @account end |
#hidden ⇒ true, false (readonly) Also known as:
Returns whether or not this image can only be seen by the uploader.
88 89 90 |
# File 'lib/weeb/data.rb', line 88 def hidden @hidden end |
#mime_type ⇒ String (readonly)
Returns the mime type of the image.
82 83 84 |
# File 'lib/weeb/data.rb', line 82 def mime_type @mime_type end |
#nsfw ⇒ true, false (readonly) Also known as: nsfw?
Returns whether or not this image is nsfw.
78 79 80 |
# File 'lib/weeb/data.rb', line 78 def nsfw @nsfw end |
#source ⇒ String? (readonly)
Returns the source of the image.
92 93 94 |
# File 'lib/weeb/data.rb', line 92 def source @source end |
#tags ⇒ Array<String> (readonly)
Returns the tags on image.
85 86 87 |
# File 'lib/weeb/data.rb', line 85 def end |
Instance Method Details
#add_tag(tag) ⇒ Object
Add a tag to the image
129 130 131 |
# File 'lib/weeb/data.rb', line 129 def add_tag(tag) @interface.(self, [tag]) end |
#add_tags(tags) ⇒ Object
Add tags to the image
117 118 119 |
# File 'lib/weeb/data.rb', line 117 def () @interface.(self, ) end |
#delete ⇒ Object Also known as: remove
Delete this image
140 141 142 |
# File 'lib/weeb/data.rb', line 140 def delete @interface.delete_image(self) end |
#inspect ⇒ Object
145 146 147 |
# File 'lib/weeb/data.rb', line 145 def inspect "#<WeebSh::WeebImage @url=#{@url.inspect} @type=#{@type.inspect} @nsfw=#{@nsfw.inspect}>" end |
#remove_tag(tag) ⇒ Object
Remove a tag to the image
135 136 137 |
# File 'lib/weeb/data.rb', line 135 def remove_tag(tag) @interface.(self, [tag]) end |
#remove_tags(tags) ⇒ Object
Remove tags from the image
123 124 125 |
# File 'lib/weeb/data.rb', line 123 def () @interface.(self, ) end |