Class: SmartCore::Container::Host Private
- Inherits:
-
Object
- Object
- SmartCore::Container::Host
- Defined in:
- lib/smart_core/container/host.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 Attribute Summary collapse
- #container ⇒ SmartCore::Container readonly private
- #exists ⇒ Boolean (also: #exists?, #present?) readonly private
- #path ⇒ String readonly private
Class Method Summary collapse
-
.build(container, path) ⇒ SmartCore::Container::Host
private
rubocop:disable Metrics/AbcSize, Style/NilComparison.
Instance Method Summary collapse
- #initialize(container, path) ⇒ void constructor private
- #notify_about_nested_changement(nested_entity_path) ⇒ void private
Constructor Details
#initialize(container, path) ⇒ 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.
63 64 65 66 67 |
# File 'lib/smart_core/container/host.rb', line 63 def initialize(container, path) @container = container @path = path @exists = !!container end |
Instance Attribute Details
#container ⇒ SmartCore::Container (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.
41 42 43 |
# File 'lib/smart_core/container/host.rb', line 41 def container @container end |
#exists ⇒ Boolean (readonly) Also known as: exists?, present?
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.
53 54 55 |
# File 'lib/smart_core/container/host.rb', line 53 def exists @exists end |
#path ⇒ String (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.
47 48 49 |
# File 'lib/smart_core/container/host.rb', line 47 def path @path end |
Class Method Details
.build(container, path) ⇒ SmartCore::Container::Host
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.
rubocop:disable Metrics/AbcSize, Style/NilComparison
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/smart_core/container/host.rb', line 16 def build(container, path) if (container.nil? && !path.nil?) || (!container.nil? && path.nil?) raise(SmartCore::Container::ArgumentError, <<~ERROR_MESSAGE) Host container requires both host container instance and host container path (container: #{container.inspect} / path: #{path.inspect}) ERROR_MESSAGE end if (!container.nil? && !path.nil?) && (!container.is_a?(SmartCore::Container) || !path.is_a?(String)) raise(SmartCore::Container::ArgumentError, <<~ERROR_MESSAGE) Host container should be a type of SmartCore::Container and host path should be a type of String. ERROR_MESSAGE end new(container, path) end |
Instance Method Details
#notify_about_nested_changement(nested_entity_path) ⇒ 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.
This method returns an undefined value.
74 75 76 77 78 79 80 |
# File 'lib/smart_core/container/host.rb', line 74 def notify_about_nested_changement(nested_entity_path) return unless exists? host_path = "#{path}" \ "#{SmartCore::Container::DependencyResolver::PATH_PART_SEPARATOR}" \ "#{nested_entity_path}" container.watcher.notify(host_path) end |