Class: NSURLSessionConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/webstub/patch/session_configuration.rb

Class Method Summary collapse

Class Method Details

.defaultSessionConfigurationObject


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/webstub/patch/session_configuration.rb', line 6

def defaultSessionConfiguration
  config = originalDefaultSessionConfiguration

  protocols = (config.protocolClasses && config.protocolClasses.clone) || []
  unless protocols.include?(WebStub::Protocol)
    protocols.unshift WebStub::Protocol
    config.protocolClasses = protocols
  end

  config
end

.ephemeralSessionConfigurationObject


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/webstub/patch/session_configuration.rb', line 20

def ephemeralSessionConfiguration
  config = originalEphemeralSessionConfiguration

  protocols = (config.protocolClasses && config.protocolClasses.clone) || []
  unless protocols.include?(WebStub::Protocol)
    protocols.unshift WebStub::Protocol
    config.protocolClasses = protocols
  end

  config
end

.originalDefaultSessionConfigurationObject


4
# File 'lib/webstub/patch/session_configuration.rb', line 4

alias_method :originalDefaultSessionConfiguration, :defaultSessionConfiguration

.originalEphemeralSessionConfigurationObject


18
# File 'lib/webstub/patch/session_configuration.rb', line 18

alias_method :originalEphemeralSessionConfiguration, :ephemeralSessionConfiguration