class VCR::Request::Typed

Decorates a {Request} with its current type.

Attributes

type[R]

@return [Symbol] One of `:ignored`, `:stubbed`, `:recordable` or `:unhandled`.

Public Class Methods

new(request, type) click to toggle source

@param [Request] request the request @param [Symbol] type the type. Should be one of `:ignored`, `:stubbed`, `:recordable` or `:unhandled`.

Calls superclass method
# File lib/vcr/structs.rb, line 254
def initialize(request, type)
  @type = type
  super(request)
end

Public Instance Methods

externally_stubbed?() click to toggle source

@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
ignored?() click to toggle source

@return [Boolean] whether or not this request is being ignored

# File lib/vcr/structs.rb, line 260
def ignored?
  type == :ignored
end
real?() click to toggle source

@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
recordable?() click to toggle source

@return [Boolean] whether or not this request will be recorded.

# File lib/vcr/structs.rb, line 280
def recordable?
  type == :recordable
end
stubbed?() click to toggle source

@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
stubbed_by_vcr?() click to toggle source

@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
unhandled?() click to toggle source

@return [Boolean] whether or not VCR knows how to handle this request.

# File lib/vcr/structs.rb, line 285
def unhandled?
  type == :unhandled
end