Sha256: 7ae5a54eac018bc2f629171c0467ffa145472f0c225e84332e60c0d595e26f26
Contents?: true
Size: 614 Bytes
Versions: 6
Compression:
Stored size: 614 Bytes
Contents
module Pageflow class ImageFileUrlTemplates def call styles.each_with_object({}) do |style, result| result[style] = replace_extension_with_placeholder( UrlTemplate.from_attachment(example_file.attachment, style) ) end end private def replace_extension_with_placeholder(url) url.gsub(/.JPG$/, '.:processed_extension') end def styles example_file.attachment_styles(example_file.attachment).keys + [:original] end def example_file @example_file ||= ImageFile.new(id: 0, file_name: ':basename.:extension') end end end
Version data entries
6 entries across 6 versions & 1 rubygems