Module: CertBot::Data::UpdateStatus
- Defined in:
- lib/cert_bot/data/update_status.rb
Overview
This module holds the update status defined by the BSI
Class Attribute Summary collapse
-
.string_mapping ⇒ Hash
private
The mapping from update status to its string representation.
Class Method Summary collapse
-
.get_mapping_for(update_status) ⇒ Symbol
module method to retrieve the severity symbol to the given severity string.
-
.initialize ⇒ Object
initialization of the static mapping values.
-
.initialize_mapping ⇒ Object
private
initializes the mapping hash.
Class Attribute Details
.string_mapping ⇒ Hash (private)
Returns the mapping from update status to its string representation.
19 20 21 |
# File 'lib/cert_bot/data/update_status.rb', line 19 def string_mapping @string_mapping end |
Class Method Details
.get_mapping_for(update_status) ⇒ Symbol
module method to retrieve the severity symbol to the given severity string
35 36 37 38 39 40 41 |
# File 'lib/cert_bot/data/update_status.rb', line 35 def self.get_mapping_for(update_status) initialize if (@string_mapping.eql?(nil)) @string_mapping.each_pair { |key, value| return value if (key.eql?(update_status)) } nil end |
.initialize ⇒ Object
initialization of the static mapping values
12 13 14 |
# File 'lib/cert_bot/data/update_status.rb', line 12 def initialize initialize_mapping end |
.initialize_mapping ⇒ Object (private)
initializes the mapping hash
22 23 24 25 26 27 28 |
# File 'lib/cert_bot/data/update_status.rb', line 22 def initialize_mapping @string_mapping = Hash.new @string_mapping["New"] = :new @string_mapping["Update"] = :update @string_mapping["Silent-Update"] = :silent_update nil end |