Module: Configuration::ImageMetaData

Included in:
Image
Defined in:
lib/httpimagestore/configuration/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#source_pathObject

Returns the value of attribute source_path.



42
43
44
# File 'lib/httpimagestore/configuration/handler.rb', line 42

def source_path
  @source_path
end

#source_urlObject

Returns the value of attribute source_url.



43
44
45
# File 'lib/httpimagestore/configuration/handler.rb', line 43

def source_url
  @source_url
end

#store_pathObject

Returns the value of attribute store_path.



44
45
46
# File 'lib/httpimagestore/configuration/handler.rb', line 44

def store_path
  @store_path
end

#store_urlObject

Returns the value of attribute store_url.



45
46
47
# File 'lib/httpimagestore/configuration/handler.rb', line 45

def store_url
  @store_url
end

Instance Method Details

#mime_extensionObject



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/httpimagestore/configuration/handler.rb', line 47

def mime_extension
	case mime_type
	when nil then nil
	when 'image/jpeg' then 'jpg'
	when 'image/png' then 'png'
	when 'image/gif' then 'gif'
	else
		# TODO: this does not work well; the resoult may not the most common extension (like 'jpeg')
		mime = MIME::Types[mime_type].first or return nil
		mime.preferred_extension
	end
end