notification-renderer 1.0.0.beta8 → 1.0.0.beta9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 015de4bf7964fec98d1500b3726937db6833244b784d4b1edaa06e99841e05d0
4
- data.tar.gz: 7adef148f1ef1b26a08aabcf3411b51469c97df1f88659a00a5528336029b941
3
+ metadata.gz: f5a96491db46d1de11191d4da18b486a6773580706581d64298e37a2c9752840
4
+ data.tar.gz: 904e108702fb02cf6bea2e04b7e588421b1c61df9b68e351b48717d1b2c016b6
5
5
  SHA512:
6
- metadata.gz: 4f223f63a2aada8d26101583d39e9299f5ea24ce863adeff542ea24141f71dec1775184a49a934b3cbd21bf62f56dc1db55cadca336dc92d367e9385fa7c661d
7
- data.tar.gz: fadeb5adefbec6448be78a1d05caa364879a8c28887657fe7ff647962d357697758edd16ea8224f2cd0284508ef350087a5270f02cac2e81af7eeb074578dae4
6
+ metadata.gz: 69b7fdc5a0c8ca5ecd27221fb274389073e58dda00dffdae86bc5b11c589532c5ff61c28110d13657dd390f874496c790edd3889fc61453664786d7f2ffd1ab8
7
+ data.tar.gz: f6acb92f8aca244c056d2fd303991e8adbb34fd65067ff9c370edc2e0ef0a1a5b1cb762d58fd528940f817681d6b0f4e89113f7111fd333eda956eaa16b4cd9f
@@ -1,12 +1,22 @@
1
1
  module NotificationRenderer
2
2
  module NotificationLibrary
3
3
 
4
- def self.grouping group_by
5
- group_by{ |notification| notification.send(group_by) }
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ include NotificationRenderer::NotificationLibrary::InstanceMethods
6
8
  end
7
9
 
8
- def type
9
- self[:type] || NotificationRenderer.configuration.default_type
10
+ module InstanceMethods
11
+
12
+ def self.grouping group_by
13
+ group_by{ |notification| notification.send(group_by) }
14
+ end
15
+
16
+ def type
17
+ self[:type] || NotificationRenderer.configuration.default_type
18
+ end
19
+
10
20
  end
11
21
 
12
22
  end
@@ -1,17 +1,27 @@
1
1
  module NotificationRenderer
2
2
  module NotificationScopes
3
-
4
- def method_missing m, *args
5
- if m.to_s[/(.+)_type/]
6
- where type: $1.singularize.classify
7
- else
8
- super
9
- end
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ include NotificationRenderer::NotificationScopes::InstanceMethods
10
8
  end
11
9
 
12
- def respond_to? m, include_private = false
13
- super || m.to_s[/(.+)_type/]
10
+ module InstanceMethods
11
+
12
+ def method_missing m, *args
13
+ if m.to_s[/(.+)_type/]
14
+ where type: $1.singularize.classify
15
+ else
16
+ super
17
+ end
18
+ end
19
+
20
+ def respond_to? m, include_private = false
21
+ super || m.to_s[/(.+)_type/]
22
+ end
23
+
14
24
  end
15
-
25
+
16
26
  end
17
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notification-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta8
4
+ version: 1.0.0.beta9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0.beta8
47
+ version: 1.0.0.beta9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0.beta8
54
+ version: 1.0.0.beta9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement