Module: BroadcastEvent::SubjectHelpers::BlockTargetLookup

Included in:
BlockManySubjectAssociation, BlockSingleSubjectAssociation
Defined in:
app/models/broadcast_event/subject_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



51
52
53
# File 'app/models/broadcast_event/subject_helpers.rb', line 51

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

Instance Method Details

#initialize(name, &block) ⇒ Object



42
43
44
45
# File 'app/models/broadcast_event/subject_helpers.rb', line 42

def initialize(name, &block)
  @name = name
  @block = block
end

#target_for(seed, event) ⇒ Object



47
48
49
# File 'app/models/broadcast_event/subject_helpers.rb', line 47

def target_for(seed, event)
  block.call(seed, event)
end