Class: Wisper::ValueObjects::Events Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wisper/value_objects/events.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Describes allowed events

Duck-types the argument to quack like array of strings when responding to the #include? method call.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize(list) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes a ‘list’ of events

Parameters:

  • list (NilClass, String, Symbol, Array, Regexp)

Returns:

  • (undefined)

Raises:

  • (ArgumentError)

    if an argument if of unsupported type



19
20
21
# File 'lib/wisper/value_objects/events.rb', line 19

def initialize(list)
  @list = list
end

Instance Method Details

#include?(event) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if given event is ‘included’ to the ‘list’ of events

Parameters:

  • event (#to_s)

Returns:

  • (Boolean)


28
29
30
# File 'lib/wisper/value_objects/events.rb', line 28

def include?(event)
  appropriate_method.call(event.to_s)
end

#new(on) ⇒ undefined

Initializes a ‘list’ of events

Parameters:

  • list (NilClass, String, Symbol, Array, Regexp)

Returns:

  • (undefined)

Raises:

  • (ArgumentError)

    if an argument if of unsupported type



19
20
21
# File 'lib/wisper/value_objects/events.rb', line 19

def initialize(list)
  @list = list
end