Class: Sprig::DependencySorter
- Inherits:
-
Object
- Object
- Sprig::DependencySorter
- Defined in:
- lib/sprig/dependency_sorter.rb
Defined Under Namespace
Classes: CircularDependencyError, MissingDependencyError
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(items) ⇒ DependencySorter
constructor
A new instance of DependencySorter.
- #sorted_items ⇒ Object
Constructor Details
#initialize(items) ⇒ DependencySorter
Returns a new instance of DependencySorter.
7 8 9 |
# File 'lib/sprig/dependency_sorter.rb', line 7 def initialize(items) @items = items.to_a end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/sprig/dependency_sorter.rb', line 5 def items @items end |
Instance Method Details
#sorted_items ⇒ Object
11 12 13 14 15 |
# File 'lib/sprig/dependency_sorter.rb', line 11 def sorted_items .map do |tag| id_dictionary[tag] end end |