Class: VCR::Request::Typed
- Inherits:
-
self
- Object
- self
- VCR::Request::Typed
- Defined in:
- lib/vcr/structs.rb
Overview
Decorates a VCR::Request with its current type.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#type ⇒ Symbol
readonly
One of ‘:ignored`, `:stubbed`, `:recordable` or `:unhandled`.
Instance Method Summary collapse
-
#externally_stubbed? ⇒ Boolean
Whether or not this request is being stubbed by an external library (such as WebMock or FakeWeb).
-
#ignored? ⇒ Boolean
Whether or not this request is being ignored.
-
#initialize(request, type) ⇒ Typed
constructor
A new instance of Typed.
-
#real? ⇒ Boolean
Whether or not this request will be made for real.
-
#recordable? ⇒ Boolean
Whether or not this request will be recorded.
-
#stubbed? ⇒ Boolean
Whether or not this request will be stubbed.
-
#stubbed_by_vcr? ⇒ Boolean
Whether or not this request is being stubbed by VCR.
-
#unhandled? ⇒ Boolean
Whether or not VCR knows how to handle this request.
Constructor Details
#initialize(request, type) ⇒ Typed
Returns a new instance of Typed.
259 260 261 262 |
# File 'lib/vcr/structs.rb', line 259 def initialize(request, type) @type = type super(request) end |
Instance Attribute Details
#type ⇒ Symbol (readonly)
Returns One of ‘:ignored`, `:stubbed`, `:recordable` or `:unhandled`.
255 256 257 |
# File 'lib/vcr/structs.rb', line 255 def type @type end |
Instance Method Details
#externally_stubbed? ⇒ Boolean
Returns whether or not this request is being stubbed by an external library (such as WebMock or FakeWeb).
280 281 282 |
# File 'lib/vcr/structs.rb', line 280 def externally_stubbed? type == :externally_stubbed end |
#ignored? ⇒ Boolean
Returns whether or not this request is being ignored.
265 266 267 |
# File 'lib/vcr/structs.rb', line 265 def ignored? type == :ignored end |
#real? ⇒ Boolean
VCR allows ‘:ignored` and `:recordable` requests to be made for real.
Returns whether or not this request will be made for real.
296 297 298 |
# File 'lib/vcr/structs.rb', line 296 def real? ignored? || recordable? end |
#recordable? ⇒ Boolean
Returns whether or not this request will be recorded.
285 286 287 |
# File 'lib/vcr/structs.rb', line 285 def recordable? type == :recordable end |
#stubbed? ⇒ Boolean
Returns whether or not this request will be stubbed. It may be stubbed by an external library or by VCR.
304 305 306 |
# File 'lib/vcr/structs.rb', line 304 def stubbed? stubbed_by_vcr? || externally_stubbed? end |
#stubbed_by_vcr? ⇒ Boolean
Returns whether or not this request is being stubbed by VCR.
272 273 274 |
# File 'lib/vcr/structs.rb', line 272 def stubbed_by_vcr? type == :stubbed_by_vcr end |
#unhandled? ⇒ Boolean
Returns whether or not VCR knows how to handle this request.
290 291 292 |
# File 'lib/vcr/structs.rb', line 290 def unhandled? type == :unhandled end |