Permalink
Browse files

Updating README examples

  • Loading branch information...
1 parent 9decb34 commit 8ed904e786a5e96190de77ab16612bf3facc2783 @czarneckid committed Apr 9, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 README.md
View
@@ -75,9 +75,6 @@ Math::AMAZING
You can also define a constant using a block which will unset the constant after the block:
```ruby
-require 'constant-redefinition'
- => true
-
class Freaks
GOOBLE = 'gobble'
end
@@ -96,6 +93,11 @@ NameError: uninitialized constant Freaks::HELLO
You can also redefine a constant using a block, which will reset the constant to its original value after the block:
```ruby
+class Freaks
+ GOOBLE = 'gobble'
+end
+ => "gobble"
+
Freaks.redefine_without_warning(:GOOBLE, 'one of us') do
p Freaks::GOOBLE
end

0 comments on commit 8ed904e

Please sign in to comment.