class Calyx::Modifiers
Applies modifiers to the output of a rule in a template substitution.
Public Instance Methods
lower(value)
click to toggle source
# File lib/calyx/modifiers.rb, line 28 def lower(value) value.downcase end
transform(name, value)
click to toggle source
Transforms an output string by delegating to the given output function.
If a registered modifier method is not found, then delegate to the given string function.
If an invalid modifier function is given, returns the raw input string.
@param [Symbol] name @param [String] value @return [String]
# File lib/calyx/modifiers.rb, line 14 def transform(name, value) if respond_to?(name) send(name, value) elsif value.respond_to?(name) value.send(name) else value end end
upper(value)
click to toggle source
# File lib/calyx/modifiers.rb, line 24 def upper(value) value.upcase end