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


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

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

Instance Method Details

#initialize(name, &block) ⇒ Object


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

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

#target_for(seed, event) ⇒ Object


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

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