3 ms·
Sans ActiveSupport, you can achieve the same things by just opening class/module eigenclass: module Foo class << self attr_accessor :bar
by cheald 13y ago
Sans ActiveSupport, you can achieve the same things by just opening class/module eigenclass:
module Foo
class << self
attr_accessor :bar
end
end
Foo.bar = "baz"
- lobster_johnson 13y agoSure, but wasn't that exactly what I wrote in my first example?
- cheald 13y agoOy, it is. Sorry; my brain is apparently missing its reading comprehension hat today.