lib/apple-news/article/attachments.rb
# I used to use the mime-types gem but apparently Rails uses version
# 1.x of the gem, which isn't even supported anymore. Since the Apple
# News API only allows a small handful of attachments, I'm okay with
# handling them myself.
I used to use the mime-types gem but apparently Rails uses version
1.x of the gem, which isn't even supported anymore. Since the Apple
News API only allows a small handful of attachments, I'm okay with
handling them myself.
I used to use the mime - types gem but apparently Rails uses version 1 . x of the gem which isn ' t even supported anymore . Since the Apple News API only allows a small handful of attachments I ' m okay with handling them myself .
def mime_for(filename)
          case File.extname(filename).downcase
          when ".jpg", ".jpeg" then "image/jpeg"
          when ".png" then "image/png"
          when ".gif" then "image/gif"
          else "application/octet-stream"
          end
        end
def mime_for ( filename ) case File . extname ( filename ) . downcase when ".jpg" , ".jpeg" then "image/jpeg" when ".png" then "image/png" when ".gif" then "image/gif" else "application/octet-stream" end end
I used to use the mime-types gem but apparently Rails uses version
1.x of the gem, which isn't even supported anymore.
I used to use the mime - types gem but apparently Rails uses version 1 . x of the gem which isn ' t even supported anymore .
filename
<not_specific>