lib/lono/conventions.rb in lono-6.1.11 vs lib/lono/conventions.rb in lono-7.0.0
- old
+ new
@@ -1,11 +1,22 @@
module Lono
- module Conventions
- # Think can make this a module, but need to figure out how it fits with lono cfn
- def template_param_convention(options)
- options = options.deep_symbolize_keys
- template = options[:template] || @blueprint
- param = options[:param] || template || @blueprint
- [template, param]
+ class Conventions
+ attr_reader :stack, :blueprint, :template, :param
+ def initialize(options)
+ @options = options
+ @stack, @blueprint, @template, @param = naming_conventions(options)
+ end
+
+ def naming_conventions(options)
+ o = options.deep_symbolize_keys
+ stack = o[:stack]
+ blueprint = o[:blueprint] || o[:stack]
+ template = o[:template] || blueprint
+ param = o[:param] || template || blueprint
+ [stack, blueprint, template, param]
+ end
+
+ def values
+ [@stack, @blueprint, @template, @param]
end
end
end