Class: Textus::Handlers::Read::DepsEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/handlers/read/deps_entry.rb

Instance Method Summary collapse

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