class CertWatch::Views::CertificateState
Constants
- STATE_MAPPING
Public Instance Methods
build(certificate_or_domain, options = {})
click to toggle source
# File lib/cert_watch/views/certificate_state.rb, line 17 def build(certificate_or_domain, options = {}) state = get_state(certificate_or_domain) format = options.fetch(:format, 'short') add_class 'cert_watch_certificate_state' status_tag(t(state, scope: "cert_watch.states.#{format}"), [state, STATE_MAPPING[state]].compact.join(' ')) end
Private Instance Methods
get_certificate(certificate_or_domain)
click to toggle source
# File lib/cert_watch/views/certificate_state.rb, line 33 def get_certificate(certificate_or_domain) if certificate_or_domain.is_a?(String) Certificate.find_by_domain(certificate_or_domain) else certificate_or_domain end end
get_state(certificate_or_domain)
click to toggle source
# File lib/cert_watch/views/certificate_state.rb, line 29 def get_state(certificate_or_domain) get_certificate(certificate_or_domain).try(:state) || 'not_found' end