Module: SchemaConformist::ProcessWithAssertion

Includes:
Driver
Included in:
ActionDispatch::Integration::Session
Defined in:
lib/schema_conformist/process_with_assertion.rb

Instance Method Summary collapse

Methods included from Driver

#committee_options, #request_object, #response_data

Instance Method Details

#ignored?(path) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
23
# File 'lib/schema_conformist/process_with_assertion.rb', line 14

def ignored?(path)
  ignored_api_paths.any? do |pattern|
    case pattern
    when String
      path.start_with?(pattern)
    when Regexp
      path.match?(pattern)
    end
  end
end

#ignored_api_pathsObject



25
26
27
# File 'lib/schema_conformist/process_with_assertion.rb', line 25

def ignored_api_paths
  Rails.application.config.schema_conformist.ignored_api_paths
end

#process(*args) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/schema_conformist/process_with_assertion.rb', line 5

def process(*args)
  super *args

  path = args[1]
  return if ignored?(path)

  assert_schema_conform
end