Class: Textus::Action::Pulse::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/action/pulse/scanner.rb

Instance Method Summary collapse

Constructor Details

#initialize(prefix: nil, lane: nil) ⇒ Scanner

Returns a new instance of Scanner.



9
10
11
12
# File 'lib/textus/action/pulse/scanner.rb', line 9

def initialize(prefix: nil, lane: nil)
  @prefix = prefix
  @lane   = lane
end

Instance Method Details

#call(container:, call:) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/textus/action/pulse/scanner.rb', line 14

def call(container:, call:)
  @container  = container
  @call       = call
  @manifest   = container.manifest
  @file_store = container.file_store

  rows = []
  @manifest.data.entries.each do |mentry|
    next if @prefix && !mentry.key.start_with?(@prefix)
    next if @lane   && mentry.lane != @lane

    rows << row_for(mentry)
  end
  rows
end