Skip to content

Instantly share code, notes, and snippets.

@yorickpeterse
Created July 11, 2014 21:46
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 yorickpeterse/29db9183c79f6ffd7844 to your computer and use it in GitHub Desktop.
Save yorickpeterse/29db9183c79f6ffd7844 to your computer and use it in GitHub Desktop.
2.1.2p95 > require 'csv'
=> true
2.1.2p95 > headers = %w{foo bar}
=> ["foo", "bar"]
2.1.2p95 > row = CSV::Row.new(headers, [10, 20])
=> #<CSV::Row "foo":10 "bar":20>
2.1.2p95 > headers.map(&:frozen?)
=> [true, true]
2.1.2p95 > headers.first.upcase!
RuntimeError: can't modify frozen String
from (pry):5:in `upcase!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment