Class: InternetSecurityEvent::X509Status
- Inherits:
-
Object
- Object
- InternetSecurityEvent::X509Status
- Includes:
- ActionView::Helpers::DateHelper
- Defined in:
- lib/internet_security_event/x509_status.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(certificate) ⇒ X509Status
constructor
A new instance of X509Status.
- #to_e ⇒ Object
Constructor Details
#initialize(certificate) ⇒ X509Status
Returns a new instance of X509Status.
12 13 14 |
# File 'lib/internet_security_event/x509_status.rb', line 12 def initialize(certificate) @certificate = certificate end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
10 11 12 |
# File 'lib/internet_security_event/x509_status.rb', line 10 def certificate @certificate end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
10 11 12 |
# File 'lib/internet_security_event/x509_status.rb', line 10 def hostname @hostname end |
Class Method Details
.build(certificate) ⇒ Object
16 17 18 19 |
# File 'lib/internet_security_event/x509_status.rb', line 16 def self.build(certificate) obj = new(certificate) obj.to_e end |
Instance Method Details
#to_e ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/internet_security_event/x509_status.rb', line 21 def to_e { state: state, description: description, metric: metric, subject: certificate.subject.to_s, issuer: certificate.issuer.to_s, serial: certificate.serial.to_i, not_before: certificate.not_before.to_s, not_after: certificate.not_after.to_s, } end |