Class: Paperclip::Interpolations::PluralCache

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

Instance Method Summary (collapse)

Constructor Details

- (PluralCache) initialize

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

- (Object) pluralize(word)



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

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

- (Object) underscore_and_pluralize(word)



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

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