1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
15 value = yield(send(property))
16 send("#{property}=", value)
25 def metaclass_eval(&blk)
26 metaclass.instance_eval(&blk)
30 yield self unless nil?
39 return i if yield item
51 key, value = yield key, value
60 self.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
61 gsub(/([a-z\d])([A-Z])/,'\1_\2').
66 gsub(/_(.)/) {|m| $1.upcase }