Class: Textus::Application::Reads::List

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/application/reads/list.rb

Instance Method Summary collapse

Constructor Details

#initialize(ctx:) ⇒ List

Returns a new instance of List.



5
6
7
# File 'lib/textus/application/reads/list.rb', line 5

def initialize(ctx:)
  @ctx = ctx
end

Instance Method Details

#call(prefix: nil, zone: nil) ⇒ Object



9
10
11
12
13
# File 'lib/textus/application/reads/list.rb', line 9

def call(prefix: nil, zone: nil)
  rows = @ctx.manifest.enumerate(prefix: prefix)
  rows = rows.select { |r| r[:manifest_entry].zone == zone } if zone
  rows.map { |row| { "key" => row[:key], "zone" => row[:manifest_entry].zone, "path" => row[:path] } }
end