class SocialAvatarProxy::AvatarFile
Attributes
file[R]
Public Class Methods
new(path, options = {})
click to toggle source
Calls superclass method
# File lib/social_avatar_proxy/avatar_file.rb, line 9 def initialize(path, options = {}) if File.exist?(path) @file = File.new(path) mtime(file.mtime) else @file = Tempfile.new(path.gsub("/", "-"), options) end super(file) end
Public Instance Methods
content_type(value = nil)
click to toggle source
# File lib/social_avatar_proxy/avatar_file.rb, line 23 def content_type(value = nil) value ? @content_type = value : @content_type end
mtime(value = nil)
click to toggle source
# File lib/social_avatar_proxy/avatar_file.rb, line 19 def mtime(value = nil) value ? @mtime = value.to_i : Time.at(@mtime) end