Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module MetaTimeDSL
- {
- :m_second => 1,
- :m_minute => 60,
- :m_hour => 3600,
- :m_day => 86400,
- :m_week => 604800,
- :m_month => 2592000,
- :m_year => 31471200,
- }.each do |meth, amount|
- define_method meth do
- self * amount
- end
- alias_method "#{meth}s".intern, meth
- end
- end
Add Comment
Please, Sign In to add comment