goon_model_gen 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/goon_model_gen/builder/abstract_builder.rb +4 -8
- data/lib/goon_model_gen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35eae7744ace6ecb88fdce49041734f3cfd1c724ef899e6996e4a4fcdd7ea59a
|
4
|
+
data.tar.gz: a32f155f2e6bb40fb48ddf3eb166e67e1d3090948bb7a4e50bd203c86317825c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bddf0a66939b7a378d6d75fab1a9770068b93817f70122ba8f27c2f2fa15004e0604c065c4d94607a13f3cc6cffdb7b51ff75a3dc604d3cfea5674512516f0d7
|
7
|
+
data.tar.gz: 070c8c3081315a3b4721291fb3969b69322378eb33d96d318dec6f5d90f3ea29662ff7bb15736482b2562d7ac6cccf8f0107f76b98fd0304826af2adf3656f48
|
@@ -55,10 +55,11 @@ module GoonModelGen
|
|
55
55
|
# @param go_type [Golang::Type]
|
56
56
|
def build_sentences_with(template_base, go_type, generators)
|
57
57
|
m2t = method_to_template_for(template_base)
|
58
|
-
generators ||=
|
59
|
-
|
58
|
+
generators ||= m2t.keys.each_with_object({}){|name, d| d[name] = true }
|
59
|
+
|
60
|
+
m2t.each do |name, template|
|
61
|
+
suffix = generators[name]
|
60
62
|
next if !suffix
|
61
|
-
template = m2t[name]
|
62
63
|
raise "No template found for #{name.inspect}" unless template
|
63
64
|
parts = [go_type.name.underscore]
|
64
65
|
custom_suffix = false
|
@@ -74,11 +75,6 @@ module GoonModelGen
|
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
77
|
-
def default_generators_for(template_base)
|
78
|
-
method_to_template_for(template_base).keys.
|
79
|
-
each_with_object({}){|name, d| d[name] = true }
|
80
|
-
end
|
81
|
-
|
82
78
|
def method_to_template_map
|
83
79
|
@method_to_template_map ||= {}
|
84
80
|
end
|