lib/method_map.rb in dirty_hashy-0.1.2 vs lib/method_map.rb in dirty_hashy-0.1.3
- old
+ new
@@ -7,11 +7,11 @@
map_method(:changed?)
map_method(:clean_up!)
map_method(/^([\w_]+)_changed\?$/, :changed?, true)
map_method(/^([\w_]+)_change$/, :change, true)
map_method(/^([\w_]+)_was$/, :was, true)
- map_method(/(^[\w_]+)=$/, :[]=)
- map_method(/(^[\w_]+)$/, :[], true)
+ map_method(/^([\w_]+)=$/, :[]=)
+ map_method(/^([\w_]+)$/, :[], true)
end
def map_method(pattern, method_or_proc = nil, args = nil)
regex = pattern.is_a?(Regexp) ? pattern : Regexp.new("^#{Regexp.escape(pattern.to_s)}$")
method_map[regex] = {:method_or_proc => (method_or_proc || pattern), :args => args}
\ No newline at end of file