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,:recordableor:unhandled.
Instance Method Summary collapse
-
#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.
-
#unhandled? ⇒ Boolean
Whether or not VCR knows how to handle this request.
Constructor Details
#initialize(request, type) ⇒ Typed
Returns a new instance of Typed.
242 243 244 245 |
# File 'lib/vcr/structs.rb', line 242 def initialize(request, type) @type = type super(request) end |
Instance Attribute Details
#type ⇒ Symbol (readonly)
Returns One of :ignored, :stubbed, :recordable or :unhandled.
238 239 240 |
# File 'lib/vcr/structs.rb', line 238 def type @type end |
Instance Method Details
#ignored? ⇒ Boolean
Returns whether or not this request is being ignored.
248 249 250 |
# File 'lib/vcr/structs.rb', line 248 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.
269 270 271 |
# File 'lib/vcr/structs.rb', line 269 def real? ignored? || recordable? end |
#recordable? ⇒ Boolean
Returns whether or not this request will be recorded.
258 259 260 |
# File 'lib/vcr/structs.rb', line 258 def recordable? type == :recordable end |
#stubbed? ⇒ Boolean
Returns whether or not this request will be stubbed.
253 254 255 |
# File 'lib/vcr/structs.rb', line 253 def stubbed? type == :stubbed end |
#unhandled? ⇒ Boolean
Returns whether or not VCR knows how to handle this request.
263 264 265 |
# File 'lib/vcr/structs.rb', line 263 def unhandled? type == :unhandled end |