Class: Yarrow::Model::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/yarrow/model/index.rb

Class Method Summary collapse

Class Method Details

.register(klass) ⇒ Object



6
7
8
9
# File 'lib/yarrow/model/index.rb', line 6

def self.register(klass)
  method_name = ActiveSupport::Inflector.pluralize(ActiveSupport::Inflector.underscore(klass.to_s)).to_sym
  define_singleton_method method_name, lambda { klass.all }
end