Created
March 6, 2014 17:47
-
-
Save qrush/9395413 to your computer and use it in GitHub Desktop.
class_attribute - http://api.rubyonrails.org/classes/Class.html#method-i-class_attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):002:0> class Foo; class_attribute :bar; end | |
=> [:bar] | |
irb(main):006:0> Foo.bar = "LOL" | |
=> "LOL" | |
irb(main):007:0> Foo.bar | |
=> "LOL" | |
irb(main):008:0> Foo.new.bar | |
=> "LOL" |
ngauthier
commented
Mar 6, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment