Class: Textus::Application::Read::Rdeps::Impl
- Inherits:
-
Object
- Object
- Textus::Application::Read::Rdeps::Impl
- Defined in:
- lib/textus/application/read/rdeps.rb
Instance Method Summary collapse
- #call(key) ⇒ Object
-
#initialize(caps:) ⇒ Impl
constructor
A new instance of Impl.
Constructor Details
#initialize(caps:) ⇒ Impl
Returns a new instance of Impl.
10 11 12 |
# File 'lib/textus/application/read/rdeps.rb', line 10 def initialize(caps:) @manifest = caps.manifest end |
Instance Method Details
#call(key) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/textus/application/read/rdeps.rb', line 14 def call(key) @manifest.data.entries.each_with_object([]) do |e, acc| next unless e.is_a?(Textus::Manifest::Entry::Derived) src = e.source sources = if src.is_a?(Textus::Manifest::Entry::Derived::Projection) Array(src.select).compact elsif src.is_a?(Textus::Manifest::Entry::Derived::External) Array(src.sources).compact else [] end acc << e.key if sources.any? { |s| s == key || key.start_with?("#{s}.") } end end |