class VCR::RequestIgnorer
@private
Constants
- LOCALHOST_ALIASES
Public Class Methods
new()
click to toggle source
# File lib/vcr/request_ignorer.rb, line 13 def initialize ignore_request do |request| host = request.parsed_uri.host ignored_hosts.include?(host) end end
Public Instance Methods
ignore?(request)
click to toggle source
# File lib/vcr/request_ignorer.rb, line 32 def ignore?(request) invoke_hook(:ignore_request, request).any? end
ignore_hosts(*hosts)
click to toggle source
# File lib/vcr/request_ignorer.rb, line 28 def ignore_hosts(*hosts) ignored_hosts.merge(hosts) end
ignore_localhost=(value)
click to toggle source
# File lib/vcr/request_ignorer.rb, line 20 def ignore_localhost=(value) if value ignore_hosts(*LOCALHOST_ALIASES) else ignored_hosts.reject! { |h| LOCALHOST_ALIASES.include?(h) } end end
Private Instance Methods
ignored_hosts()
click to toggle source
# File lib/vcr/request_ignorer.rb, line 38 def ignored_hosts @ignored_hosts ||= Set.new end