Module: SslRequirement

Extended by:
ActiveSupport::Concern
Defined in:
lib/ssl_requirement.rb

Overview

Copyright © 2005 David Heinemeier Hansson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.disable_ssl_check?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/ssl_requirement.rb', line 64

def self.disable_ssl_check?
  @@disable_ssl_check ||= false
end

.non_ssl_hostObject



39
40
41
# File 'lib/ssl_requirement.rb', line 39

def self.non_ssl_host
  determine_host(@@non_ssl_host) rescue nil
end

.non_ssl_portObject



43
44
45
# File 'lib/ssl_requirement.rb', line 43

def self.non_ssl_port
  @@non_ssl_port ||= 80
end

.ssl_hostObject



31
32
33
# File 'lib/ssl_requirement.rb', line 31

def self.ssl_host
  determine_host(@@ssl_host) rescue nil
end

.ssl_portObject



35
36
37
# File 'lib/ssl_requirement.rb', line 35

def self.ssl_port
  @@ssl_port ||= 443
end

Instance Method Details

#non_ssl_hostObject



56
57
58
# File 'lib/ssl_requirement.rb', line 56

def non_ssl_host
  SslRequirement.non_ssl_host
end

#non_ssl_portObject



60
61
62
# File 'lib/ssl_requirement.rb', line 60

def non_ssl_port
  SslRequirement.non_ssl_port
end

#ssl_hostObject

mattr_reader would generate both ssl_host and self.ssl_host



48
49
50
# File 'lib/ssl_requirement.rb', line 48

def ssl_host
  SslRequirement.ssl_host
end

#ssl_portObject



52
53
54
# File 'lib/ssl_requirement.rb', line 52

def ssl_port
  SslRequirement.ssl_port
end