Class: ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection
- Inherits:
-
Object
- Object
- ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection
- Includes:
- Support::Delegate
- Defined in:
- lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #for(types) ⇒ Object
-
#initialize ⇒ CallbackCollection
constructor
A new instance of CallbackCollection.
Methods included from Support::Concern
Constructor Details
#initialize ⇒ CallbackCollection
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
#callbacks ⇒ Object (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 |