Class: GeoConcerns::EventsGenerator::CompositeGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/geo_concerns/events_generator/composite_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*generators) ⇒ CompositeGenerator

Returns a new instance of CompositeGenerator.



6
7
8
# File 'app/services/geo_concerns/events_generator/composite_generator.rb', line 6

def initialize(*generators)
  @generators = generators.compact
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



10
11
12
13
14
15
# File 'app/services/geo_concerns/events_generator/composite_generator.rb', line 10

def method_missing(m, *args)
  generators.each do |generator|
    next unless generator.respond_to? m
    generator.send(m, args.first)
  end
end

Instance Attribute Details

#generatorsObject (readonly)

Returns the value of attribute generators.



4
5
6
# File 'app/services/geo_concerns/events_generator/composite_generator.rb', line 4

def generators
  @generators
end