Class: Weneedfeed::Capture

Inherits:
Object
  • Object
show all
Defined in:
lib/weneedfeed/capture.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url:, schema_path:) ⇒ Capture

Returns a new instance of Capture.

Parameters:

  • base_url (String)
  • schema_path (String)


23
24
25
26
27
28
29
# File 'lib/weneedfeed/capture.rb', line 23

def initialize(
  base_url:,
  schema_path:
)
  @base_url = base_url
  @schema_path = schema_path
end

Class Method Details

.call(base_url:, schema_path:) ⇒ Object

Parameters:

  • base_url (String)
  • schema_path (String)


10
11
12
13
14
15
16
17
18
# File 'lib/weneedfeed/capture.rb', line 10

def call(
  base_url:,
  schema_path:
)
  new(
    base_url: base_url,
    schema_path: schema_path
  ).call
end

Instance Method Details

#callObject



31
32
33
34
35
36
37
38
39
# File 'lib/weneedfeed/capture.rb', line 31

def call
  urls.each do |url|
    ::Rack::Capture.call(
      app: app,
      script_name: script_name,
      url: url
    )
  end
end