class Bricolage::StreamingLoad::ChunkRouter::Route

Public Class Methods

new(url:, schema:, table:) click to toggle source
# File lib/bricolage/streamingload/chunkrouter.rb, line 31
def initialize(url:, schema:, table:)
  @url_pattern = /\A#{url}\z/
  @schema = schema
  @table = table
end

Public Instance Methods

get_component(m, label) click to toggle source
# File lib/bricolage/streamingload/chunkrouter.rb, line 44
def get_component(m, label)
  if /\A%/ =~ label
    m[label[1..-1]]
  else
    label
  end
end
match(url) click to toggle source
# File lib/bricolage/streamingload/chunkrouter.rb, line 37
def match(url)
  m = @url_pattern.match(url) or return nil
  c1 = get_component(m, @schema)
  c2 = get_component(m, @table)
  "#{c1}.#{c2}"
end