Class: Theatre::CallbackDefinitionLoader::BlankSlateMessageRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/theatre/callback_definition_loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(&notify_on_completion) ⇒ BlankSlateMessageRecorder

Returns a new instance of BlankSlateMessageRecorder.



66
67
68
69
# File 'lib/theatre/callback_definition_loader.rb', line 66

def initialize(&notify_on_completion)
  @notify_on_completion = notify_on_completion
  @namespaces = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*method_name_and_args) ⇒ Object

Raises:

  • (ArgumentError)


71
72
73
74
75
# File 'lib/theatre/callback_definition_loader.rb', line 71

def method_missing(*method_name_and_args)
  raise ArgumentError, "Supplying a block is not supported" if block_given?
  @namespaces << method_name_and_args
  self
end

Instance Method Details

#each(&callback) ⇒ Object



77
78
79
# File 'lib/theatre/callback_definition_loader.rb', line 77

def each(&callback)
  @notify_on_completion.call(@namespaces, callback)
end