Class: ConvenientService::Support::DependencyContainer::Entities::MethodCollection Private
- Inherits:
-
Object
- Object
- ConvenientService::Support::DependencyContainer::Entities::MethodCollection
- Defined in:
- lib/convenient_service/support/dependency_container/entities/method_collection.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #<<(method) ⇒ ConvenientService::Support::DependencyContainer::Entities::MethodCollection private
- #==(other) ⇒ Boolean? private
- #clear ⇒ ConvenientService::Support::DependencyContainer::Entities::MethodCollection private
- #empty? ⇒ Boolean private
- #find_by(name: Support::NOT_PASSED, slug: Support::NOT_PASSED, scope: Support::NOT_PASSED) ⇒ ConvenientService::Support::DependencyContainer::Entities::Method? private
- #include?(method) ⇒ Boolean private
- #initialize(methods: []) ⇒ void constructor private
- #to_a ⇒ Array private
Constructor Details
#initialize(methods: []) ⇒ 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.
17 18 19 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 17 def initialize(methods: []) @methods = methods end |
Instance Method Details
#<<(method) ⇒ ConvenientService::Support::DependencyContainer::Entities::MethodCollection
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.
43 44 45 46 47 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 43 def <<(method) methods << method self end |
#==(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.
84 85 86 87 88 89 90 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 84 def ==(other) return unless other.instance_of?(self.class) return false if methods != other.methods true end |
#clear ⇒ ConvenientService::Support::DependencyContainer::Entities::MethodCollection
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.
67 68 69 70 71 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 67 def clear methods.clear self end |
#empty? ⇒ 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.
52 53 54 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 52 def empty? methods.empty? end |
#find_by(name: Support::NOT_PASSED, slug: Support::NOT_PASSED, scope: Support::NOT_PASSED) ⇒ ConvenientService::Support::DependencyContainer::Entities::Method?
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.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 27 def find_by(name: Support::NOT_PASSED, slug: Support::NOT_PASSED, scope: Support::NOT_PASSED) rules = [] rules << ->(method) { method.name.to_s == name.to_s } unless Support::NOT_PASSED[name] rules << ->(method) { method.slug.to_s == slug.to_s } unless Support::NOT_PASSED[slug] rules << ->(method) { method.scope == scope } unless Support::NOT_PASSED[scope] condition = Utils::Proc.conjunct(rules) methods.find(&condition) end |
#include?(method) ⇒ 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.
60 61 62 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 60 def include?(method) methods.include?(method) end |
#to_a ⇒ Array
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 |
# File 'lib/convenient_service/support/dependency_container/entities/method_collection.rb', line 76 def to_a methods.to_a end |