Module: Representable::ForCollection

Defined in:
lib/representable/for_collection.rb

Overview

Gives us Representer::for_collection and its configuration directive ::collection_representer.

Instance Method Summary collapse

Instance Method Details

#for_collectionObject


5
6
7
8
# File 'lib/representable/for_collection.rb', line 5

def for_collection
  # this is done at run-time, not a big fan of this. however, it saves us from inheritance/self problems.
  @collection_representer ||= collection_representer!({}) # DON'T make it inheritable as it would inherit the wrong singular.
end