Module: Paperclip::Interpolations

Defined in:
lib/rad/paperclip/extensions.rb

Instance Method Summary collapse

Instance Method Details

#account(attachment, style) ⇒ Object



52
53
54
# File 'lib/rad/paperclip/extensions.rb', line 52

def  attachment, style
  Account.current.name
end

#crystal_root(attachment, style) ⇒ Object



60
61
62
# File 'lib/rad/paperclip/extensions.rb', line 60

def crystal_root attachment, style
  crystal.config.root('')
end

#filename_with_style(attachment, style) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/rad/paperclip/extensions.rb', line 28

def filename_with_style attachment, style
  val = filename(attachment, style).clone
  if style.to_s != 'original'
    basename_index = val.rindex('.') || (val.size - 1)
    val.insert basename_index, ".#{style}"
  end
  val
end

#space(attachment, style) ⇒ Object



56
57
58
# File 'lib/rad/paperclip/extensions.rb', line 56

def space attachment, style
  Space.current.name
end