Class: WeebSh::WeebImage

Inherits:
PreviewImage show all
Defined in:
lib/weeb/data.rb

Overview

Represents an image for toph

Instance Attribute Summary collapse

Attributes inherited from PreviewImage

#file_type, #type, #url

Attributes included from IDObject

#id

Instance Method Summary collapse

Methods included from IDObject

#==

Instance Attribute Details

#accountString (readonly) Also known as: uploader, author



96
97
98
# File 'lib/weeb/data.rb', line 96

def 
  @account
end

#hiddentrue, false (readonly) Also known as: hidden?



89
90
91
# File 'lib/weeb/data.rb', line 89

def hidden
  @hidden
end

#mime_typeString (readonly)



83
84
85
# File 'lib/weeb/data.rb', line 83

def mime_type
  @mime_type
end

#nsfwtrue, false (readonly) Also known as: nsfw?



79
80
81
# File 'lib/weeb/data.rb', line 79

def nsfw
  @nsfw
end

#sourceString? (readonly)



93
94
95
# File 'lib/weeb/data.rb', line 93

def source
  @source
end

#tagsArray<String> (readonly)



86
87
88
# File 'lib/weeb/data.rb', line 86

def tags
  @tags
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.add_tags_to_image(self, [tag])
end

#add_tags(tags) ⇒ Object

Add tags to the image



118
119
120
# File 'lib/weeb/data.rb', line 118

def add_tags(tags)
  @interface.add_tags_to_image(self, tags)
end

#deleteObject Also known as: remove

Delete this image



141
142
143
# File 'lib/weeb/data.rb', line 141

def delete()
  @interface.delete_image(self)
end

#inspectObject



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.remove_tags_to_image(self, [tag])
end

#remove_tags(tags) ⇒ Object

Remove tags from the image



124
125
126
# File 'lib/weeb/data.rb', line 124

def remove_tags(tags)
  @interface.remove_tags_to_image(self, tags)
end