Class: ApiBlueprint::Runner

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/api-blueprint/runner.rb

Instance Method Summary collapse

Instance Method Details

#run(item, cache_options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/api-blueprint/runner.rb', line 8

def run(item, cache_options = {})
  if item.is_a?(Blueprint)
    run_blueprint item, cache_options
  elsif item.is_a?(Collection)
    run_collection item, cache_options
  else
    raise ArgumentError, "expected a blueprint or blueprint collection, got #{item.class}"
  end
end

#runner_optionsObject



18
19
20
# File 'lib/api-blueprint/runner.rb', line 18

def runner_options
  { headers: headers, cache: cache }
end