Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created October 16, 2008 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonroelofs/17242 to your computer and use it in GitHub Desktop.
Save jasonroelofs/17242 to your computer and use it in GitHub Desktop.
>> require 'map'
=> true
>> m = Std::Map.new
=> #<Std::Map:0xb78aaa04>
>> m[0] = 1
=> 1
>> m.each { |x| p x }
[0, 1]
=> #<Std::Map:0xb78aaa04>
>> require 'sample_enum'
=> true
>> m = Std::Map.new
=> #<Std::Map:0xb789ef10>
>> m[0] = 1
RuntimeError: Derived type is unbound
from (irb):7:in `[]='
from (irb):7
>> Sample_Enum.each { |x| p x }
#<Sample_Enum::FOO>
#<Sample_Enum::BAR>
#<Sample_Enum::BAZ>
=> nil
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment