Module: Wpxf::ModuleInfo
- Included in:
- Module
- Defined in:
- lib/wpxf/core/module_info.rb
Overview
Provides functionality for specifying module metadata.
Instance Method Summary collapse
-
#emit_usage_info ⇒ Object
Emits any information that the user should be aware of before using the module.
-
#initialize ⇒ Object
Initialize a new instance of ModuleInfo.
-
#module_author ⇒ Array
The name of the module author(s).
-
#module_date ⇒ Date
The disclosure date of the vulnerability.
-
#module_desc ⇒ String
The description of the module.
-
#module_description_preformatted ⇒ Boolean
True if the description is preformatted.
-
#module_name ⇒ String
The name of the module.
-
#module_references ⇒ Array
An aray of references relating to the module.
-
#update_info(info) ⇒ Object
Update the module info.
Instance Method Details
#emit_usage_info ⇒ Object
Emits any information that the user should be aware of before using the module.
54 55 56 |
# File 'lib/wpxf/core/module_info.rb', line 54 def emit_usage_info nil end |
#initialize ⇒ Object
Initialize a new instance of Wpxf::ModuleInfo.
7 8 9 10 |
# File 'lib/wpxf/core/module_info.rb', line 7 def initialize super @_module_info = {} end |
#module_author ⇒ Array
Returns the name of the module author(s).
39 40 41 |
# File 'lib/wpxf/core/module_info.rb', line 39 def @_module_info[:author] end |
#module_date ⇒ Date
Returns the disclosure date of the vulnerability.
44 45 46 |
# File 'lib/wpxf/core/module_info.rb', line 44 def module_date @_module_info[:date] end |
#module_desc ⇒ String
Returns the description of the module.
29 30 31 |
# File 'lib/wpxf/core/module_info.rb', line 29 def module_desc @_module_info[:desc] end |
#module_description_preformatted ⇒ Boolean
Returns true if the description is preformatted.
49 50 51 |
# File 'lib/wpxf/core/module_info.rb', line 49 def module_description_preformatted @_module_info[:desc_preformatted] end |
#module_name ⇒ String
Returns the name of the module.
24 25 26 |
# File 'lib/wpxf/core/module_info.rb', line 24 def module_name @_module_info[:name] end |
#module_references ⇒ Array
Returns an aray of references relating to the module.
34 35 36 |
# File 'lib/wpxf/core/module_info.rb', line 34 def module_references @_module_info[:references] end |
#update_info(info) ⇒ Object
Update the module info.
14 15 16 17 18 19 20 21 |
# File 'lib/wpxf/core/module_info.rb', line 14 def update_info(info) required_keys = %i[name desc author date] unless required_keys.all? { |key| info.key?(key) || @_module_info.key?(key) } raise 'Missing one or more required module info keys' end _update_info_without_validation(info) end |