lib/convection/model/template/output.rb in convection-0.0.1 vs lib/convection/model/template/output.rb in convection-0.2.1
- old
+ new
@@ -1,35 +1,37 @@
+require 'json'
require_relative '../../dsl/intrinsic_functions'
require_relative '../mixin/conditional'
module Convection
module Model
class Template
##
# Resource
##
class Output
- extend DSL::Helpers
- include DSL::IntrinsicFunctions
+ include DSL::Helpers
include Model::Mixin::Conditional
+ attribute :name
attribute :value
attribute :description
+ attr_reader :template
- def initialize(name, template)
+ def initialize(name, parent)
@name = name
- @template = template
+ @template = parent.template
@type = ''
@properties = {}
end
def render
{
- 'Value' => value,
+ 'Value' => value.respond_to?(:render) ? value.render : value,
'Description' => description
- }.tap do |resource|
- render_condition(resource)
+ }.tap do |output|
+ render_condition(output)
end
end
end
end
end