mystique 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mystique.rb +5 -6
- data/lib/mystique/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 482f42f03487da63811a81cf4d7165e12da4bdabfa6e407875d967a6a33e2fe4
|
|
4
|
+
data.tar.gz: 64d18da6b66829c706916dafc7269732a35f6a4e96750942ae7312dae141bd70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3de791b96f273c1043cc9ecffb19af4388b73d1ca1a1e85ce123b32e2432c254c64a434d8acac8f4971a954e5867a140deaaf2ea0b069241ef1dff983540db72
|
|
7
|
+
data.tar.gz: 7c7aa58c789cdf9b62a1c6b76f73968f65bd0b55966dc31c0e3a6144279dc92a20f6e6848347a030e0809f43ad0e8319c4b729fc1adf226a4c390fb6db7abc01
|
data/lib/mystique.rb
CHANGED
|
@@ -6,9 +6,7 @@ require "mystique/undefined"
|
|
|
6
6
|
require "mystique/presenter"
|
|
7
7
|
|
|
8
8
|
module Mystique
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def present(object, with: nil, context: nil, &block)
|
|
9
|
+
def self.present(object, with: nil, context: nil, &block)
|
|
12
10
|
begin
|
|
13
11
|
presenter_class = presenter_class_for(object, with)
|
|
14
12
|
presenter_class.for(object, context, &block)
|
|
@@ -17,7 +15,7 @@ module Mystique
|
|
|
17
15
|
end
|
|
18
16
|
end
|
|
19
17
|
|
|
20
|
-
def present_collection(collection, context: nil, with: nil, &block)
|
|
18
|
+
def self.present_collection(collection, context: nil, with: nil, &block)
|
|
21
19
|
return to_enum(:present_collection, collection, context: context, with: with, &block) unless block_given?
|
|
22
20
|
|
|
23
21
|
collection.each do |element|
|
|
@@ -30,8 +28,9 @@ module Mystique
|
|
|
30
28
|
end
|
|
31
29
|
end
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def self.presenter_class_for(object, with)
|
|
34
34
|
with || Object.send(:const_get, "#{object.class}Presenter")
|
|
35
35
|
end
|
|
36
|
-
private :presenter_class_for
|
|
37
36
|
end
|
data/lib/mystique/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mystique
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Federico Iachetti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-05-
|
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|