class SparkleFormation::AzureVariableStruct
Function struct specialized for Azure variables to check nested variable function value and properly match defined case
Attributes
_fn_context[R]
SparkleStruct
-
context of function usage
Public Instance Methods
_dump()
click to toggle source
Wrapper to check for nested function call and properly case the function if found.
Calls superclass method
SparkleFormation::FunctionStruct#_dump
# File lib/sparkle_formation/function_struct.rb, line 237 def _dump # Remap nested function keys if possible if _fn_context && _fn_context.root!.data![_fn_name] && _fn_context.root!.data![_fn_name].data![_fn_args.first] __valid_keys = _fn_context.root!.data![_fn_name].data![_fn_args.first].keys! __current_key = @table.keys.first __match_key = __current_key.to_s.downcase.gsub("_", "") __key_remap = __valid_keys.detect do |__nested_key| __nested_key.to_s.downcase.gsub("_", "") == __match_key end if __key_remap @table[__key_remap] = @table.delete(@table.keys.first) end end super end
_fn_context=(ctx)
click to toggle source
Set current function context
@param ctx [SparkleStruct] current context @return [SparkleStruct]
# File lib/sparkle_formation/function_struct.rb, line 231 def _fn_context=(ctx) @_fn_context = ctx end
_klass()
click to toggle source
@return [Class]
# File lib/sparkle_formation/function_struct.rb, line 254 def _klass ::SparkleFormation::AzureVariableStruct end