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 40 def ignore?(request) invoke_hook(:ignore_request, request).any? end
ignore_hosts(*hosts)
click to toggle source
# File lib/vcr/request_ignorer.rb, line 32 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
localhost_ignored?()
click to toggle source
# File lib/vcr/request_ignorer.rb, line 28 def localhost_ignored? (LOCALHOST_ALIASES & ignore_hosts.to_a).any? end
unignore_hosts(*hosts)
click to toggle source
# File lib/vcr/request_ignorer.rb, line 36 def unignore_hosts(*hosts) ignored_hosts.subtract(hosts) end
Private Instance Methods
ignored_hosts()
click to toggle source
# File lib/vcr/request_ignorer.rb, line 46 def ignored_hosts @ignored_hosts ||= Set.new end