Class: ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection

Inherits:
Object
  • Object
show all
Includes:
Support::Delegate
Defined in:
lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::Concern

included

Constructor Details

#initializeCallbackCollection

Returns a new instance of CallbackCollection.



15
16
17
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 15

def initialize
  @callbacks = []
end

Instance Attribute Details

#callbacksObject (readonly)

Returns the value of attribute callbacks.



11
12
13
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 11

def callbacks
  @callbacks
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 23

def ==(other)
  return unless other.instance_of?(self.class)

  return false if callbacks != other.callbacks

  true
end

#for(types) ⇒ Object



19
20
21
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 19

def for(types)
  callbacks.select { |callback| callback.types.contain_exactly?(types) }
end