I
Intransition
Thoughts on this:
module Foo
def self.append_features(base)
base.extend self
end
def foo
# ...
end
end
I have done the above at times, as opposed to the alternative:
module Foo
def self.append_features(base)
base.extend ClassMethods
end
module ClassMethods
def foo
# ...
end
end
end
b/c I never liked having this non-descript module about --it feels
extraneous.
The downside of the former approach is that there is no way to ever
actually *include* the module's methods, but for the purposes of the
program that's almost certainly a YAGNI.
Any other downsides?
module Foo
def self.append_features(base)
base.extend self
end
def foo
# ...
end
end
I have done the above at times, as opposed to the alternative:
module Foo
def self.append_features(base)
base.extend ClassMethods
end
module ClassMethods
def foo
# ...
end
end
end
b/c I never liked having this non-descript module about --it feels
extraneous.
The downside of the former approach is that there is no way to ever
actually *include* the module's methods, but for the purposes of the
program that's almost certainly a YAGNI.
Any other downsides?