Method: Mustermann::Expander#expand
- Defined in:
- lib/mustermann/expander.rb
#expand(behavior = nil, values = {}) ⇒ String
Returns expanded string.
145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/mustermann/expander.rb', line 145 def (behavior = nil, values = {}) behavior, values = nil, behavior if behavior.is_a? Hash values = map_values(values) case behavior || additional_values when :raise then .(values) when :ignore then with_rest(values) { |uri, rest| uri } when :append then with_rest(values) { |uri, rest| append(uri, rest) } else raise ArgumentError, "unknown behavior %p" % behavior end end |