Class: Paperclip::Interpolations::PluralCache

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip/interpolations/plural_cache.rb

Instance Method Summary collapse

Constructor Details

#initializePluralCache

Returns a new instance of PluralCache



4
5
6
# File 'lib/paperclip/interpolations/plural_cache.rb', line 4

def initialize
  @cache = {}
end

Instance Method Details

#pluralize(word) ⇒ Object



8
9
10
# File 'lib/paperclip/interpolations/plural_cache.rb', line 8

def pluralize(word)
  @cache[word] ||= word.pluralize
end

#underscore_and_pluralize(word) ⇒ Object



12
13
14
# File 'lib/paperclip/interpolations/plural_cache.rb', line 12

def underscore_and_pluralize(word)
  @cache[word] ||= word.underscore.pluralize
end