Created
April 28, 2009 20:35
-
-
Save jamesgolick/103386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'mixico' | |
| module Bytes | |
| def self.mixin | |
| Fixnum.send(:include, Bytes) | |
| end | |
| def self.mixout | |
| Fixnum.send(:disable_mixin, Bytes) | |
| end | |
| def megabyte | |
| 1048576 | |
| end | |
| end | |
| def with(mod) | |
| mod.mixin | |
| yield | |
| mod.mixout | |
| end | |
| with(Bytes) do | |
| puts 1.megabyte | |
| end | |
| 1.megabyte |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment