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



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

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

Instance Method Details

#initialize(name, method) ⇒ Object



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

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

#target_for(seed, _event) ⇒ Object



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

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