lib/rake/funnel/support/argument_mapper/styles/default.rb in rake-funnel-0.18.0 vs lib/rake/funnel/support/argument_mapper/styles/default.rb in rake-funnel-0.19.0
- old
+ new
@@ -10,17 +10,18 @@
@prefix = '/'
@value_separator = ','
end
def generate_from(model)
- model.map { |switch|
- switch.values.flatten.map { |value|
+ model.map do |switch|
+ switch.values.flatten.map do |value|
[top_level(switch), nested(value)].reject(&:empty?)
- }
- }.flatten(2)
+ end
+ end.flatten(2)
end
private
+
def top_level(switch)
[prefix, switch.switch]
end
def nested(value)