module PaperclipPrivate::Interpolations

Public Class Methods

extended(base) click to toggle source
# File lib/paperclip_private/interpolations.rb, line 4
def self.extended(base)
  base.instance_eval do
    ::PaperclipPrivate::Interpolations.instance_methods(false).each { |m| define_method(m, self.method(m)) }
  end
end

Public Instance Methods

attachment_singular(attachment, style_name) click to toggle source

Returns the attachment name without pluralizing it

# File lib/paperclip_private/interpolations.rb, line 23
def attachment_singular(attachment, style_name)
  attachment.name
end
klass(attachment, style_name) click to toggle source

Returns the class name without pluarlizing it.

# File lib/paperclip_private/interpolations.rb, line 18
def klass(attachment, style_name)
  attachment.instance.class
end
privacy(attachment, style_name) click to toggle source

Returns the privacy

# File lib/paperclip_private/interpolations.rb, line 11
def privacy(attachment, style_name)
  # attachment.options[:privacy]
  privacy = attachment.options[:privacy]
  privacy.respond_to?(:call) ? privacy.call(attachment.instance) : privacy
end