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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78f1ab5ccbbf1b0616a6f356821e99e2924db3f8fd97d63dda3683f2ee9f1e77
4
- data.tar.gz: 3783aae3295a6d463d17d6373bdeff11f03c80b1f468ce7efc8f8e553fa6fccd
3
+ metadata.gz: 482f42f03487da63811a81cf4d7165e12da4bdabfa6e407875d967a6a33e2fe4
4
+ data.tar.gz: 64d18da6b66829c706916dafc7269732a35f6a4e96750942ae7312dae141bd70
5
5
  SHA512:
6
- metadata.gz: bdcc1105ac7249b50c6b1562954b15190010aad2cb44f62a4c7748e76ea1159702654a4a81edb34c5704138ac718a004386c13599b99774ce11ae003ab7979e0
7
- data.tar.gz: d74357da79a1dc761f56b702e082d32c5e3f0ad3692b96cc06248c0c25d334f923fa789e6a43445121dec1137f000c806361feb53b8e8425f54670e94d32b664
6
+ metadata.gz: 3de791b96f273c1043cc9ecffb19af4388b73d1ca1a1e85ce123b32e2432c254c64a434d8acac8f4971a954e5867a140deaaf2ea0b069241ef1dff983540db72
7
+ data.tar.gz: 7c7aa58c789cdf9b62a1c6b76f73968f65bd0b55966dc31c0e3a6144279dc92a20f6e6848347a030e0809f43ad0e8319c4b729fc1adf226a4c390fb6db7abc01
@@ -6,9 +6,7 @@ require "mystique/undefined"
6
6
  require "mystique/presenter"
7
7
 
8
8
  module Mystique
9
- module_function
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
- def presenter_class_for(object, with)
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
@@ -1,3 +1,3 @@
1
1
  module Mystique
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
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.1
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-13 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler