Class: OpenvasCli::VasNVTFamily
- Defined in:
- lib/openvas-cli/vas_nvt_family.rb
Overview
Category for NVT rules
Instance Attribute Summary collapse
-
#is_growing ⇒ Object
Returns the value of attribute is_growing.
-
#name ⇒ Object
Category Name.
-
#nvt_count ⇒ Object
Number of rules in the family.
Attributes inherited from VasBase
Class Method Summary collapse
- .from_xml_node(node) ⇒ Object
-
.get_all(options = {}) ⇒ Object
Pulls all NVT Families defined on the server.
Methods inherited from VasBase
#create_or_update, #delete_record, #destroy, #destroy!, get_by_id, #initialize, #new_record?, #reset_changes, #save, #save!, #to_key, #to_param, #update_attributes
Methods included from ConnAddin
Methods included from XmlAddin
Constructor Details
This class inherits a constructor from OpenvasCli::VasBase
Instance Attribute Details
#is_growing ⇒ Object
Returns the value of attribute is_growing.
10 11 12 |
# File 'lib/openvas-cli/vas_nvt_family.rb', line 10 def is_growing @is_growing end |
#name ⇒ Object
Category Name
7 8 9 |
# File 'lib/openvas-cli/vas_nvt_family.rb', line 7 def name @name end |
#nvt_count ⇒ Object
Number of rules in the family
9 10 11 |
# File 'lib/openvas-cli/vas_nvt_family.rb', line 9 def nvt_count @nvt_count end |
Class Method Details
.from_xml_node(node) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/openvas-cli/vas_nvt_family.rb', line 37 def self.from_xml_node(node) family = VasNVTFamily.new family.name = extract_value_from('name', node) family.nvt_count = extract_value_from('max_nvt_count', node).to_i family.is_growing = (extract_value_from("growing", node).to_i > 0) family end |
.get_all(options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/openvas-cli/vas_nvt_family.rb', line 21 def self.get_all( = {}) req = Nokogiri::XML::Builder.new { |xml| xml.get_nvt_families } fams = connection.send_receive(req.doc) ret = [] fams.xpath('//family').each { |f| ret << from_xml_node(f) } ret end |