Class: Textus::Handlers::Read::DepsEntry
- Inherits:
-
Object
- Object
- Textus::Handlers::Read::DepsEntry
- Defined in:
- lib/textus/handlers/read/deps_entry.rb
Instance Method Summary collapse
- #call(command, _call) ⇒ Object
-
#initialize(manifest:) ⇒ DepsEntry
constructor
A new instance of DepsEntry.
Constructor Details
#initialize(manifest:) ⇒ DepsEntry
Returns a new instance of DepsEntry.
5 6 7 |
# File 'lib/textus/handlers/read/deps_entry.rb', line 5 def initialize(manifest:) @manifest = manifest end |
Instance Method Details
#call(command, _call) ⇒ Object
9 10 11 12 13 |
# File 'lib/textus/handlers/read/deps_entry.rb', line 9 def call(command, _call) entry = @manifest.data.entries.find { |e| e.key == command.key } deps = entry&.external? ? Array(entry.source&.sources).compact : [] Value::Result.success("key" => command.key, "deps" => deps.uniq) end |