Class: Imgur::Client::Image

Inherits:
Model
  • Object
show all
Defined in:
lib/imgur/models/image.rb

Instance Method Summary collapse

Methods inherited from Model

assoc_accessor, assoc_reader, assoc_writer

Instance Method Details

#commentsObject



30
31
32
33
34
# File 'lib/imgur/models/image.rb', line 30

def comments
  type = is_album ? "album" : "image"
  data = connection.get_comments(type: type, id: id).body["data"]
  connection.comments.load(data)
end

#deleteObject



25
26
27
28
# File 'lib/imgur/models/image.rb', line 25

def delete
  data = connection.delete_image(deletehash).body
  connection.basic_responses.new(data)
end

#open_in_browserObject



21
22
23
# File 'lib/imgur/models/image.rb', line 21

def open_in_browser
  Launchy.open(link)
end