Module: BroadcastEvent::SubjectHelpers::SimpleTargetLookup

Included in:
SimpleManySubjectAssociation, SimpleSingleSubjectAssociation
Defined in:
app/models/broadcast_event/subject_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


35
36
37
# File 'app/models/broadcast_event/subject_helpers.rb', line 35

def self.included(base)
  base.class_eval { attr_reader :name, :method }
end

Instance Method Details

#initialize(name, method) ⇒ Object


26
27
28
29
# File 'app/models/broadcast_event/subject_helpers.rb', line 26

def initialize(name, method)
  @name = name
  @method = method
end

#target_for(seed, _event) ⇒ Object


31
32
33
# File 'app/models/broadcast_event/subject_helpers.rb', line 31

def target_for(seed, _event)
  seed.send(method)
end