Module: Kadmin::Presentable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Finder, Navbar::Link, Navbar::Section, Pager, Select2
- Defined in:
- lib/kadmin/presentable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#present(view = nil) ⇒ Object
Delegates present to a newly instantiated presenter object Checks the including class’ presenter_class attribute, with fallback to an inner Presenter class.
Instance Method Details
#present(view = nil) ⇒ Object
Delegates present to a newly instantiated presenter object Checks the including class’ presenter_class attribute, with fallback to an inner Presenter class
25 26 27 28 29 30 31 |
# File 'lib/kadmin/presentable.rb', line 25 def present(view = nil) if self.class.presenter_class.nil? raise Kadmin::Error, 'cannot present without a presenter_class' else return self.class.presenter_class.new(self, view: view) end end |