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.
33 34 35 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 33 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.
19 20 21 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 19 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.
71 72 73 74 75 76 77 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 71 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>
40 41 42 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 40 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.
60 61 62 63 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 60 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.
26 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 26 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.
50 51 52 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/entities/callback_collection.rb', line 50 def for(types) callbacks.select { |callback| callback.types.contain_exactly?(types) } end |