Class: SSLCheck::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/sslcheck/check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = nil, validator = nil) ⇒ Check

Returns a new instance of Check.



4
5
6
7
8
9
# File 'lib/sslcheck/check.rb', line 4

def initialize(client=nil, validator=nil)
  @client = client || Client.new
  @validator = validator || Validator.new
  @errors = []
  @checked = false
end

Instance Attribute Details

#ca_bundleObject

Returns the value of attribute ca_bundle.



3
4
5
# File 'lib/sslcheck/check.rb', line 3

def ca_bundle
  @ca_bundle
end

#host_nameObject

Returns the value of attribute host_name.



3
4
5
# File 'lib/sslcheck/check.rb', line 3

def host_name
  @host_name
end

#peer_certObject

Returns the value of attribute peer_cert.



3
4
5
# File 'lib/sslcheck/check.rb', line 3

def peer_cert
  @peer_cert
end

Instance Method Details

#check(url) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/sslcheck/check.rb', line 11

def check(url)
  fetch(url)
  validate if no_errors?
  @checked = true
  @url = url
  return self
end

#checked?Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/sslcheck/check.rb', line 33

def checked?
  return true if @checked
  false
end

#errorsObject



19
20
21
# File 'lib/sslcheck/check.rb', line 19

def errors
  @errors
end

#failed?Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/sslcheck/check.rb', line 23

def failed?
  return false if no_errors?
  true
end

#urlObject



38
39
40
# File 'lib/sslcheck/check.rb', line 38

def url
  @url
end

#valid?Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'lib/sslcheck/check.rb', line 28

def valid?
  return true if no_errors? && checked?
  false
end