class VCR::Request::Typed
Decorates a {Request} with its current type.
Attributes
@return [Symbol] One of `:ignored`, `:stubbed`, `:recordable` or `:unhandled`.
Public Class Methods
@param [Request] request the request @param [Symbol] type the type. Should be one of `:ignored`, `:stubbed`, `:recordable` or `:unhandled`.
# File lib/vcr/structs.rb, line 254 def initialize(request, type) @type = type super(request) end
Public Instance Methods
@return [Boolean] whether or not this request is being stubbed by an
external library (such as WebMock or FakeWeb).
@see stubbed_by_vcr? @see stubbed?
# File lib/vcr/structs.rb, line 275 def externally_stubbed? type == :externally_stubbed end
@return [Boolean] whether or not this request is being ignored
# File lib/vcr/structs.rb, line 260 def ignored? type == :ignored end
@return [Boolean] whether or not this request will be made for real. @note VCR allows `:ignored` and `:recordable` requests to be made for real.
# File lib/vcr/structs.rb, line 291 def real? ignored? || recordable? end
@return [Boolean] whether or not this request will be recorded.
# File lib/vcr/structs.rb, line 280 def recordable? type == :recordable end
@return [Boolean] whether or not this request will be stubbed.
It may be stubbed by an external library or by VCR.
@see stubbed_by_vcr? @see externally_stubbed?
# File lib/vcr/structs.rb, line 299 def stubbed? stubbed_by_vcr? || externally_stubbed? end
@return [Boolean] whether or not this request is being stubbed by VCR @see externally_stubbed? @see stubbed?
# File lib/vcr/structs.rb, line 267 def stubbed_by_vcr? type == :stubbed_by_vcr end
@return [Boolean] whether or not VCR knows how to handle this request.
# File lib/vcr/structs.rb, line 285 def unhandled? type == :unhandled end