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 47 48 49 50 51 |
# File 'lib/convection/model/template/condition.rb', line 40 def render rendered_values = [] @function_arguments.each do |function_arg| if function_arg.respond_to? :render # the argument is another conditional function rendered_values << function_arg.render else rendered_values << function_arg end end { CONDITIONAL_FUNCTION_SYNTAX_MAP[@function_name] => rendered_values } end |