module SchemaConformist::ProcessWithAssertion

Public Instance Methods

process(method, path, **kwargs) click to toggle source
Calls superclass method
# File lib/schema_conformist/process_with_assertion.rb, line 5
def process(method, path, **kwargs)
  super

  return if schema_conformist_ignored_path?(path)

  assert_schema_conform
end

Private Instance Methods

schema_conformist_ignored_api_paths() click to toggle source
# File lib/schema_conformist/process_with_assertion.rb, line 26
def schema_conformist_ignored_api_paths
  Rails.application.config.schema_conformist.ignored_api_paths
end
schema_conformist_ignored_path?(path) click to toggle source
# File lib/schema_conformist/process_with_assertion.rb, line 15
def schema_conformist_ignored_path?(path)
  schema_conformist_ignored_api_paths.any? do |pattern|
    case pattern
    when String
      path.start_with?(pattern)
    when Regexp
      path.match?(pattern)
    end
  end
end