Module: BroadcastEvent::MetadataHelpers::MetadatableClassMethods

Included in:
BroadcastEvent
Defined in:
app/models/broadcast_event/metadata_helpers.rb

Instance Method Summary collapse

Instance Method Details

#has_metadata(key, method = nil, &block) ⇒ Object

Raises:

  • (StandardError)

27
28
29
30
31
32
# File 'app/models/broadcast_event/metadata_helpers.rb', line 27

def (key, method = nil, &block)
  return  << SimpleMetadataFinder.new(key, method) unless method.nil?
  return  << BlockMetadataFinder.new(key, &block) unless block.nil?

  raise StandardError, "No block or method defined for #{key} on #{name}"
end

#metadata_findersObject


34
35
36
# File 'app/models/broadcast_event/metadata_helpers.rb', line 34

def 
  @metadata_finders ||= []
end