Module: Folio::PerPageIncluder

Included in:
Folio
Defined in:
lib/folio.rb

Overview

this funny pattern is so that if a module (e.g. Folio::Ordinal) includes this module, it won’t get the per_page attribute, but will still be able to bestow that attribute on any class that includes it.

Instance Method Summary collapse

Instance Method Details

#included(klass) ⇒ Object



78
79
80
81
82
83
84
# File 'lib/folio.rb', line 78

def included(klass)
  if klass.is_a?(Class)
    klass.extend ::Folio::PerPage
  else
    klass.extend ::Folio::PerPageIncluder
  end
end