Class: AssetGroup
- Inherits:
-
Object
- Object
- AssetGroup
- Defined in:
- lib/domain/asset_group/model.rb
Instance Attribute Summary collapse
-
#assets ⇒ Object
Returns the value of attribute assets.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#risk_score ⇒ Object
Returns the value of attribute risk_score.
-
#search_criteria ⇒ Object
Returns the value of attribute search_criteria.
-
#type ⇒ Object
Returns the value of attribute type.
-
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:, risk_score:, search_criteria:, assets: [], description: '', type: 'dynamic', vulnerabilities: []) ⇒ AssetGroup
constructor
A new instance of AssetGroup.
- #to_json(*_options) ⇒ Object
Constructor Details
#initialize(id:, name:, risk_score:, search_criteria:, assets: [], description: '', type: 'dynamic', vulnerabilities: []) ⇒ AssetGroup
Returns a new instance of AssetGroup.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/domain/asset_group/model.rb', line 23 def initialize( id:, name:, risk_score:, search_criteria:, assets: [], description: '', type: 'dynamic', vulnerabilities: [] ) @assets = assets @description = description @id = id @name = name @risk_score = risk_score @search_criteria = search_criteria @type = type @vulnerabilities = vulnerabilities end |
Instance Attribute Details
#assets ⇒ Object
Returns the value of attribute assets.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def assets @assets end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def name @name end |
#risk_score ⇒ Object
Returns the value of attribute risk_score.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def risk_score @risk_score end |
#search_criteria ⇒ Object
Returns the value of attribute search_criteria.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def search_criteria @search_criteria end |
#type ⇒ Object
Returns the value of attribute type.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def type @type end |
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
14 15 16 |
# File 'lib/domain/asset_group/model.rb', line 14 def vulnerabilities @vulnerabilities end |
Class Method Details
.from_json(data) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/domain/asset_group/model.rb', line 39 def self.from_json(data) AssetGroup.new( assets: data['assets'], description: data['description'], id: data['id'], name: data['name'], risk_score: data['riskScore'], search_criteria: SearchCriteria.from_json(data['searchCriteria']), type: data['type'], vulnerabilities: data['vulnerabilities'] ) end |
Instance Method Details
#to_json(*_options) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/domain/asset_group/model.rb', line 52 def to_json(*) { assets:, description:, id:, name:, risk_score:, search_criteria: search_criteria.to_json, type:, vulnerabilities: } end |