module PaperclipPrivate module Interpolations def self.extended(base) base.instance_eval do ::PaperclipPrivate::Interpolations.instance_methods(false).each { |m| define_method(m, self.method(m)) } end end # Returns the privacy def privacy(attachment, style_name) # attachment.options[:privacy] privacy = attachment.options[:privacy] privacy.respond_to?(:call) ? privacy.call(attachment.instance) : privacy end # Returns the class name without pluarlizing it. def klass(attachment, style_name) attachment.instance.class end # Returns the attachment name without pluralizing it def attachment_singular(attachment, style_name) attachment.name end end end