Module: Lifer::Shared::FinderMethods::ClassMethods
- Defined in:
- lib/lifer/shared/finder_methods.rb
Overview
This module contains the class methods to be included in other classes.
Instance Method Summary collapse
-
#find(name) ⇒ Class
A simple finder.
Instance Method Details
#find(name) ⇒ Class
A simple finder.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lifer/shared/finder_methods.rb', line 23 def find(name) result = subclasses.detect { |klass| klass.name == name.to_sym } if result.nil? raise StandardError, I18n.t("shared.finder_methods.unknown_class", name:) return end result end |