Guest User

Untitled

a guest
Feb 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. module Foo
  2. %w{ mount umount }.each {|m| self.module_eval "def self.#{m}; '#{m}' end" }
  3. end
  4.  
  5. #=> ["mount", "umount"]
  6.  
  7. Foo.mount
  8.  
  9. #=> "mount"
  10.  
  11. Foo.umount
  12.  
  13. #=> "umount"
Add Comment
Please, Sign In to add comment