Class: SmartCore::Container::DependencyResolver::Route Private
- Inherits:
-
Object
- Object
- SmartCore::Container::DependencyResolver::Route
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/container/dependency_resolver/route.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.
Defined Under Namespace
Classes: Cursor
Constant Summary collapse
- PATH_PART_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'.'
Instance Attribute Summary collapse
- #path ⇒ String readonly private
- #size ⇒ Integer readonly private
Class Method Summary collapse
- .build(path) ⇒ SmartCore::Container::DependencyResolver::Route private
- .build_path(*path_parts) ⇒ Array<String> private
Instance Method Summary collapse
- #each(&block) ⇒ Enumerable private
- #initialize(path) ⇒ void constructor private
Constructor Details
#initialize(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.
53 54 55 56 57 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 53 def initialize(path) @path = path @path_parts = path.split(PATH_PART_SEPARATOR).freeze @size = @path_parts.size end |
Instance Attribute Details
#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.
46 47 48 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 46 def path @path end |
#size ⇒ Integer (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.
40 41 42 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 40 def size @size end |
Class Method Details
.build(path) ⇒ SmartCore::Container::DependencyResolver::Route
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.
23 24 25 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 23 def build(path) new(SmartCore::Container::KeyGuard.indifferently_accessable_key(path)) end |
.build_path(*path_parts) ⇒ Array<String>
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 32 33 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 31 def build_path(*path_parts) path_parts.join(PATH_PART_SEPARATOR) end |
Instance Method Details
#each(&block) ⇒ Enumerable
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 69 70 71 72 73 74 |
# File 'lib/smart_core/container/dependency_resolver/route.rb', line 65 def each(&block) enumerator = Enumerator.new do |yielder| path_parts.each_with_index do |path_part, path_part_index| cursor = Cursor.new(path_part, path_part_index, self) yielder.yield(cursor) end end block_given? ? enumerator.each(&block) : enumerator end |