Skip to content

Instantly share code, notes, and snippets.

@tcrayford
Created March 18, 2011 10:50
Show Gist options
  • Save tcrayford/875889 to your computer and use it in GitHub Desktop.
Save tcrayford/875889 to your computer and use it in GitHub Desktop.
Ruby's structs can lead to weird nils
irb(main):001:0> Month = Struct.new(:year, :month)
=> Month
irb(main):002:0> Month.new(1)
=> #<struct Month year=1, month=nil>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment