Class: ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection
- Inherits:
-
Object
- Object
- ConvenientService::Common::Plugins::HasCallbacks::Entities::CallbackCollection
- Includes:
- Support::Delegate, Enumerable
- Defined in:
- lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
Instance Attribute Summary collapse
- #callbacks ⇒ Object readonly private
- #types ⇒ ConvenientService::Common::Plugins::HasCallbacks::Entities::TypeCollection readonly
Instance Method Summary collapse
- #==(other) ⇒ Boolean private
- #callback_class ⇒ Class<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback>
- #create(**kwargs) ⇒ ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback private
- #each ⇒ Array<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback> private
- #for(types) ⇒ Array<ConvenientService::Common::Plugins::HasCallbacks::Entities::Callback> private
- #initialize ⇒ void constructor private
Methods included from Support::Concern
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/has_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/has_callbacks/entities/callback_collection.rb', line 19 def callbacks @callbacks end |
#types ⇒ ConvenientService::Common::Plugins::HasCallbacks::Entities::TypeCollection (readonly)
19 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 19 attr_reader :callbacks |
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/has_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::HasCallbacks::Entities::Callback>
40 41 42 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb', line 40 def callback_class Entities::Callback end |
#create(**kwargs) ⇒ ConvenientService::Common::Plugins::HasCallbacks::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/has_callbacks/entities/callback_collection.rb', line 60 def create(**kwargs) Entities::Callback.new(**kwargs) .tap { |callback| callbacks << callback } end |
#each ⇒ Array<ConvenientService::Common::Plugins::HasCallbacks::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/has_callbacks/entities/callback_collection.rb', line 26 delegate :each, to: :callbacks |
#for(types) ⇒ Array<ConvenientService::Common::Plugins::HasCallbacks::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/has_callbacks/entities/callback_collection.rb', line 50 def for(types) callbacks.select { |callback| callback.types.contain_exactly?(types) } end |