Module: PaperclipPrivate::Interpolations
- Defined in:
- lib/paperclip_private/interpolations.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#attachment_singular(attachment, style_name) ⇒ Object
Returns the attachment name without pluralizing it.
-
#klass(attachment, style_name) ⇒ Object
Returns the class name without pluarlizing it.
-
#privacy(attachment, style_name) ⇒ Object
Returns the privacy.
Class Method Details
.extended(base) ⇒ Object
4 5 6 7 8 |
# 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 |
Instance Method Details
#attachment_singular(attachment, style_name) ⇒ Object
Returns the attachment name without pluralizing it
23 24 25 |
# File 'lib/paperclip_private/interpolations.rb', line 23 def (, style_name) .name end |
#klass(attachment, style_name) ⇒ Object
Returns the class name without pluarlizing it.
18 19 20 |
# File 'lib/paperclip_private/interpolations.rb', line 18 def klass(, style_name) .instance.class end |
#privacy(attachment, style_name) ⇒ Object
Returns the privacy
11 12 13 14 15 |
# File 'lib/paperclip_private/interpolations.rb', line 11 def privacy(, style_name) # attachment.options[:privacy] privacy = .[:privacy] privacy.respond_to?(:call) ? privacy.call(.instance) : privacy end |