123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Notifications::CustomNotification

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: rspec-core/lib/rspec/core/notifications.rb

Overview

CustomNotification is used when sending custom events to formatters / other registered listeners, it creates attributes based on supplied hash of options.

Class Method Summary

Class Method Details

.for(options = {}) ⇒ CustomNotification

Build a custom notification based on the supplied option key / values.

Parameters:

  • options (Hash) (defaults to: {})

    A hash of method / value pairs to create on this notification

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/notifications.rb', line 519

def self.for(options={})
  return NullNotification if options.keys.empty?
  new(*options.keys).new(*options.values)
end