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
- DEFAULT_OBJECT =
Object- SUFFIX =
"Presenter"- VERSION =
"0.2.7"
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
23 24 25 26 27 |
# File 'lib/presenter_object.rb', line 23 def self.load_presenter!(name) namespaces.detect do |space| space.const_get "#{name}#{SUFFIX}" rescue nil end || DEFAULT_OBJECT 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
19 20 21 |
# File 'lib/presenter_object.rb', line 19 def self.namespaces @namespaces ||= [DEFAULT_OBJECT] end |