Class: ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::CallbackCollection
- Inherits:
-
Object
- Object
- ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::CallbackCollection
- Includes:
- Support::Delegate, Enumerable
- Defined in:
- lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb
Instance Attribute Summary collapse
- #callbacks ⇒ Object readonly private
Instance Method Summary collapse
- #==(other) ⇒ Boolean? private
- #callback_class ⇒ Class<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback>
- #create(**kwargs) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback private
- #each ⇒ Array<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback> private
- #for(types) ⇒ Array<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback> private
- #initialize ⇒ void constructor private
Methods included from Support::Delegate::ClassMethodsForForwardable
Constructor Details
#initialize ⇒ void
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.
38 39 40 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 38 def initialize @callbacks = [] end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
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.
24 25 26 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 24 def callbacks @callbacks end |
Instance Method Details
#==(other) ⇒ 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.
76 77 78 79 80 81 82 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 76 def ==(other) return unless other.instance_of?(self.class) return false if callbacks != other.callbacks true end |
#callback_class ⇒ Class<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback>
45 46 47 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 45 def callback_class Entities::Callback end |
#create(**kwargs) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
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.
65 66 67 68 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 65 def create(**kwargs) Entities::Callback.new(**kwargs) .tap { |callback| callbacks << callback } end |
#each ⇒ Array<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback>
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.
31 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 31 delegate :each, to: :callbacks |
#for(types) ⇒ Array<ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback>
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.
55 56 57 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 55 def for(types) callbacks.select { |callback| callback.types.contain_exactly?(types) } end |