Sha256: fb93c38f1e5e50cbee04e9dbf2e46771c9214ef671fd6d28207376099aa2cea3

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

module SocialAvatarProxy
  class Config
    class << self
      attr_accessor :default_image
      
      def default_image_file
        default_image && File.new(default_image)
      end
      
      def default_image_data
        default_image_file.read
      end
      
      def default_image_content_type
        case File.extname(default_image).downcase
        when /^\.jpe?g$/
          "image/jpeg"
        when /^\.png$/
          "image/png"
        when /^\.gif$/
          "image/gif"
        when /^\.svg$/
          "image/svg+xml"
        else
          "application/octet-stream"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social-avatar-proxy-1.2.0 lib/social_avatar_proxy/config.rb