Array
`NormalizedArray` is an internal abstract wrapper class that calls a callback `normalize_element` anytime an element is added to the Array.
`Extensions` and `Paths` are subclasses of `NormalizedArray`.
# File lib/hike/normalized_array.rb, line 24 def <<(element) super normalize_element(element) end
# File lib/hike/normalized_array.rb, line 12 def []=(*args) value = args.pop if value.respond_to?(:to_ary) value = normalize_elements(value) else value = normalize_element(value) end super(*args.concat([value])) end
# File lib/hike/normalized_array.rb, line 28 def collect! super do |element| result = yield element normalize_element(result) end end
# File lib/hike/normalized_array.rb, line 37 def insert(index, *elements) super index, *normalize_elements(elements) end
# File lib/hike/normalized_array.rb, line 53 def normalize_elements(elements) elements.map do |element| normalize_element(element) end end
# File lib/hike/normalized_array.rb, line 41 def push(*elements) super(*normalize_elements(elements)) end
Generated with the Darkfish Rdoc Generator 2.