Class: Convection::Model::Template::Condition::ConditionalFunction
- Inherits:
-
Object
- Object
- Convection::Model::Template::Condition::ConditionalFunction
- Defined in:
- lib/convection/model/template/condition.rb
Instance Method Summary collapse
-
#initialize(function_name, arg_array) ⇒ ConditionalFunction
constructor
A new instance of ConditionalFunction.
- #render ⇒ Object
Constructor Details
#initialize(function_name, arg_array) ⇒ ConditionalFunction
Returns a new instance of ConditionalFunction.
35 36 37 38 |
# File 'lib/convection/model/template/condition.rb', line 35 def initialize(function_name, arg_array) @function_name = function_name @function_arguments = arg_array end |
Instance Method Details
#render ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/convection/model/template/condition.rb', line 40 def render rendered_values = Array(@function_arguments).map do |function_arg| function_arg.respond_to?(:render) ? function_arg.render : function_arg end { CONDITIONAL_FUNCTION_SYNTAX_MAP[@function_name] => rendered_values } end |