presenter_object 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/presenter_object/version.rb +1 -1
- data/lib/presenter_object.rb +14 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bc7b88b75126bf2f6bc0470f4575c3b60d3b674
|
4
|
+
data.tar.gz: 50a6d1c69a7cee1569e6070cd0cedc86e6d83fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c97848dba8ce24d2726fc6e60bed440cf458d3455223c206fe8c41896122ca892e35e7b75a9b6aeefeffc04f936293431a76bcdaadde13df0b6c0d7f4c9d249
|
7
|
+
data.tar.gz: 2d40723bd9425a3610895948ab9b64fa290272bc3ed5e42702aa1ac642848477fa21ed2122a30b05fb33997f78d57e7ae8dbfacdef6d6e35e19c6a1e8e6f3239
|
data/lib/presenter_object.rb
CHANGED
@@ -9,9 +9,20 @@ require "presenter_object/collection"
|
|
9
9
|
module PresenterObject
|
10
10
|
SUFFIX = "Presenter"
|
11
11
|
|
12
|
+
# If your presenters are namespaced, add the namespace module to this array
|
13
|
+
# in case you have loading problems in development. This helps me find the presenter.
|
14
|
+
# e.g
|
15
|
+
# in /lib/initializers/presenter_object.rb
|
16
|
+
# PresenterObject.namespaces << MyAwesomeSpace
|
17
|
+
#
|
18
|
+
def self.namespaces
|
19
|
+
@namespaces ||= [Object]
|
20
|
+
end
|
21
|
+
|
12
22
|
def self.load_presenter!(name)
|
13
|
-
|
14
|
-
|
15
|
-
|
23
|
+
namespaces.each do |space|
|
24
|
+
presenter = space.const_get "#{name}#{SUFFIX}" rescue nil
|
25
|
+
return presenter if presenter
|
26
|
+
end
|
16
27
|
end
|
17
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: presenter_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|