Given the following classes:
class Collector
end
class Iterator
def initialize data, collector
@collector = collector
@data = data
end
...
end
class Parser
def initialize data, collector
@collector = collector
@data = data
end
...
end
There are multiple Iterator
and Parser
classes scoped in modules. They need the parent class for basic info and configuration that is dependant on the type and source of data.
Using a gem like https://github.com/RidiculousPower/sender would be perfect, but it seems slow and doesn't compile anymore.
What would be an elegant way to have the instantiator object instead of always repeating it in new
calls and ìnitialize
methods?