Method: Addressable::Template#variables

Defined in:
lib/addressable/template.rb

#variablesArray Also known as: keys, names

Returns an Array of variables used within the template pattern. The variables are listed in the Array in the order they appear within the pattern. Multiple occurrences of a variable within a pattern are not represented in this Array.

Returns:

  • (Array)

    The variables present in the template’s pattern.



607
608
609
# File 'lib/addressable/template.rb', line 607

def variables
  @variables ||= ordered_variable_defaults.map { |var, val| var }.uniq
end