Module: ImgurRails::InstanceMethods

Defined in:
lib/imgur_rails.rb

Instance Method Summary collapse

Instance Method Details

#is_image?Boolean Also known as: is_imgur_image?

Returns:

  • (Boolean)


35
36
37
# File 'lib/imgur_rails.rb', line 35

def is_image?
  true
end

#thumbnail(size = :small) ⇒ Object



30
31
32
33
# File 'lib/imgur_rails.rb', line 30

def thumbnail( size = :small )
  type = { :small => :jpeg, :medium => :jpg }[size]
  Imgur.url_for self.image_hash, :filetype => type, :size => size
end

#urlObject



25
26
27
28
# File 'lib/imgur_rails.rb', line 25

def url
  type = ( self.respond_to? :filetype ) ? self.filetype : :detect
  Imgur.url_for self.image_hash, :filetype => type
end