module Snippr::Normalizer
Public Class Methods
add(normalizer_or_normalizers)
click to toggle source
# File lib/snippr/normalizer.rb, line 12 def self.add(normalizer_or_normalizers) @normalizers = Array(@normalizers) + Array(normalizer_or_normalizers) end
normalize(path_element)
click to toggle source
Sends the given path element to all the configured normalizers and returns the result.
# File lib/snippr/normalizer.rb, line 17 def self.normalize(path_element) @normalizers.inject(path_element) {|e, normalizer| normalizer.normalize e} end
normalizers()
click to toggle source
Returns a (modifiable) list of normalizers that'll be used to normalize a path element.
# File lib/snippr/normalizer.rb, line 8 def self.normalizers @normalizers ||= [] end