Module: PresenterObject
- Defined in:
- lib/presenter_object.rb,
lib/presenter_object/version.rb
Defined Under Namespace
Modules: Delegation, Presentable Classes: Base, Collection
Constant Summary collapse
- SUFFIX =
"Presenter"- VERSION =
"0.2.5"
Class Method Summary collapse
- .load_presenter!(name) ⇒ Object
-
.namespaces ⇒ Object
If your presenters are namespaced, add the namespace module to this array in case you have loading problems in development.
Class Method Details
.load_presenter!(name) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/presenter_object.rb', line 22 def self.load_presenter!(name) namespaces.each do |space| presenter = space.const_get "#{name}#{SUFFIX}" rescue nil return presenter if presenter end end |
.namespaces ⇒ Object
If your presenters are namespaced, add the namespace module to this array in case you have loading problems in development. This helps me find the presenter. e.g in /lib/initializers/presenter_object.rb PresenterObject.namespaces << MyAwesomeSpace
18 19 20 |
# File 'lib/presenter_object.rb', line 18 def self.namespaces @namespaces ||= [Object] end |