class Addressable::Template
def expand_neg_operator(argument, variables, mapping, partial=false)
-
(String)
- The expanded result.
Parameters:
-
mapping
(Hash
) -- The mapping of variables to values. -
variables
(Array
) -- The variables the operator is working on. -
argument
(String
) -- The argument to the operator.
def expand_neg_operator(argument, variables, mapping, partial=false) variables_present = variables.any? do |variable| mapping[variable] != [] && mapping[variable] end if partial && !variables_present "{-neg|#{argument}|#{variables.join(",")}}" elsif variables_present "" else argument end end