can_play 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/can_play/version.rb +1 -1
- data/lib/can_play.rb +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c81ae7827dd27f109d747595eb8e96d60de3089
|
4
|
+
data.tar.gz: e30b740ae3afb6b37fc1e2ed206f25da0c961d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf442e042eba7431302500371f61e6216c7989990143ddbe6d9c291aeb94cb8ca9882cc5003cd49a71ea624be23503434e3989d54a8afdf43131fdb7d5a6d7a5
|
7
|
+
data.tar.gz: 6409b25d4ee731b4cf3d8f7ebb88106a7958b746eff753d712a82cc3aae89cd5184476bb28acea62db6abcba559bc01a47dc25571f2a829b3f2ea5c77d50a1aa
|
data/lib/can_play/version.rb
CHANGED
data/lib/can_play.rb
CHANGED
@@ -30,6 +30,10 @@ module CanPlay
|
|
30
30
|
@grouped_resources ||= CanPlay.resources.multi_group_by(:module_name, :group)
|
31
31
|
end
|
32
32
|
|
33
|
+
def splat_grouped_resources
|
34
|
+
@grouped_resources ||= CanPlay.resources.multi_group_by(:group)
|
35
|
+
end
|
36
|
+
|
33
37
|
def my_resources
|
34
38
|
CanPlay.resources
|
35
39
|
end
|
@@ -51,6 +55,22 @@ module CanPlay
|
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
58
|
+
|
59
|
+
def splat_grouped_resources_with_chinese_desc
|
60
|
+
splat_grouped_resources.tap do |i|
|
61
|
+
i.each do |group, resources|
|
62
|
+
group[:chinese_desc] = begin
|
63
|
+
name = I18n.t("can_play.class_name.#{group[:name].singularize}", default: '')
|
64
|
+
name = group[:klass].model_name.human if name.blank?
|
65
|
+
name
|
66
|
+
end
|
67
|
+
resources.each do |resource|
|
68
|
+
resource[:chinese_desc] = I18n.t("can_play.authority_name.#{group[:name].singularize}.#{resource[:verb]}", default: '').presence || I18n.t("can_play.authority_name.common.#{resource[:verb]}")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
i.rehash
|
72
|
+
end
|
73
|
+
end
|
54
74
|
end
|
55
75
|
|
56
76
|
module Config
|