Class: Asset

Inherits:
Domain::Model show all
Defined in:
lib/domain/asset/model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Domain::Model

columns, from_csv, headers, #initialize, primary_key, table_name, #to_csv, #to_hash, #to_s, view

Constructor Details

This class inherits a constructor from Domain::Model

Instance Attribute Details

#assessed_for_vulnerabilitiesObject

Returns the value of attribute assessed_for_vulnerabilities.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def assessed_for_vulnerabilities
  @assessed_for_vulnerabilities
end

#host_nameObject

Returns the value of attribute host_name.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def host_name
  @host_name
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def id
  @id
end

#ipObject

Returns the value of attribute ip.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def ip
  @ip
end

#macObject

Returns the value of attribute mac.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def mac
  @mac
end

#osObject

Returns the value of attribute os.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def os
  @os
end

#os_certaintyObject

Returns the value of attribute os_certainty.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def os_certainty
  @os_certainty
end

#risk_scoreObject

Returns the value of attribute risk_score.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def risk_score
  @risk_score
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def type
  @type
end

#vulnerabilitiesObject

Returns the value of attribute vulnerabilities.



6
7
8
# File 'lib/domain/asset/model.rb', line 6

def vulnerabilities
  @vulnerabilities
end

Class Method Details

.from_json(data) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/domain/asset/model.rb', line 9

def self.from_json(data)
  new(
    id: data['id'],
    host_name: data['hostName'],
    ip: data['ip'],
    mac: data['mac'],
    os: data['os'],
    os_certainty: data['osCertainty'],
    type: data['type'],
    risk_score: data['riskScore'],
    assessed_for_vulnerabilities: data['assessedForVulnerabilities'],
    vulnerabilities: data['vulnerabilities']
  )
end