D
Daniel Waite
I'm having a problem of design. I've tried a few configurations of class
collaboration and responsibility, but they all end up feeling messy.
I'm looking at these (either or, my original attempt was with a module,
but attr_accessor *looks* like it does what I want):
class C < Translator::Base
translate 'this', :to => 'that'
end
class C
include Translator
translate 'this', :to => 'that'
end
With the expectation that...
c = C.new
c.translations
Would yield a hash of the from and to values.
I have no idea how to break the barrier between class and instance.
Any ideas?
collaboration and responsibility, but they all end up feeling messy.
I'm looking at these (either or, my original attempt was with a module,
but attr_accessor *looks* like it does what I want):
class C < Translator::Base
translate 'this', :to => 'that'
end
class C
include Translator
translate 'this', :to => 'that'
end
With the expectation that...
c = C.new
c.translations
Would yield a hash of the from and to values.
I have no idea how to break the barrier between class and instance.
Any ideas?