Class: Frenchy::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/frenchy/collection.rb

Instance Method Summary collapse

Instance Method Details

#decorateObject

Decorate the collection using the name of the decorator inferred by the first record



4
5
6
7
# File 'lib/frenchy/collection.rb', line 4

def decorate
  decorator_class = "#{first.class.name}Decorator".constantize
  decorator_class.decorate(self)
end

#nil?Boolean

Backwards compatibility for old version of draper

Returns:

  • (Boolean)


10
11
12
# File 'lib/frenchy/collection.rb', line 10

def nil?
  none?
end