Skip to content

Instantly share code, notes, and snippets.

@aderyabin
Created April 22, 2013 14:21
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 aderyabin/5435465 to your computer and use it in GitHub Desktop.
Save aderyabin/5435465 to your computer and use it in GitHub Desktop.
cattr_accessor
require 'active_support/all'
class A
cattr_accessor :id
end
B = Class.new(A)
B.id = 'b'
C = Class.new(A)
C.id = 'c'
B.id
=> "c"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment