Created
January 14, 2011 15:51
-
-
Save HotFusionMan/779769 to your computer and use it in GitHub Desktop.
How to add a "class-level" method to an existing module.
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
module PerfectBitsMath | |
def number_of_squares_in_interval( m, n ) | |
1 | |
end | |
end | |
module Math | |
extend PerfectBitsMath | |
end | |
puts 'The next line should read "true":' | |
puts Math.number_of_squares_in_interval( 4, 4 ) == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment