Class: Jets::Cfn::Params::Api::Base
- Inherits:
-
Object
- Object
- Jets::Cfn::Params::Api::Base
- Extended by:
- Memoist
- Defined in:
- lib/jets/cfn/params/api/base.rb
Instance Method Summary collapse
-
#build ⇒ Object
noop by default.
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#load_template ⇒ Object
Nice to be able to use template or template_path so the common Template.load_file is centralized.
- #params ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 |
# File 'lib/jets/cfn/params/api/base.rb', line 13 def initialize(={}) @options = @template = load_template # current paged template_path @params = ActiveSupport::HashWithIndifferentAccess.new end |
Instance Method Details
#build ⇒ Object
noop by default
37 |
# File 'lib/jets/cfn/params/api/base.rb', line 37 def build; end |
#load_template ⇒ Object
Nice to be able to use template or template_path so the common Template.load_file is centralized.
27 28 29 30 31 32 33 34 35 |
# File 'lib/jets/cfn/params/api/base.rb', line 27 def load_template if @options[:template] # At Cfn::Builders::Api::Methods build time, template is in memory @options[:template] else # At Resource::Nested::Api::Methods build time, template is on disk Jets::Cfn::Template.load_file(@options[:template_path]) end end |
#params ⇒ Object
19 20 21 22 |
# File 'lib/jets/cfn/params/api/base.rb', line 19 def params build # interface method @params end |