Class: Tenable::Models::Scan

Inherits:
Data
  • Object
show all
Defined in:
lib/tenable/models/scan.rb

Overview

Represents a Tenable.io scan.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#creation_dateObject (readonly)

Returns the value of attribute creation_date

Returns:

  • (Object)

    the current value of creation_date



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def creation_date
  @creation_date
end

#folder_idObject (readonly)

Returns the value of attribute folder_id

Returns:

  • (Object)

    the current value of folder_id



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def folder_id
  @folder_id
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def id
  @id
end

#last_modification_dateObject (readonly)

Returns the value of attribute last_modification_date

Returns:

  • (Object)

    the current value of last_modification_date



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def last_modification_date
  @last_modification_date
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def type
  @type
end

#uuidObject (readonly)

Returns the value of attribute uuid

Returns:

  • (Object)

    the current value of uuid



6
7
8
# File 'lib/tenable/models/scan.rb', line 6

def uuid
  @uuid
end

Class Method Details

.from_api(data) ⇒ Scan

Builds a Scan from a raw API response hash.

Parameters:

  • data (Hash)

    raw API response hash with string keys

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tenable/models/scan.rb', line 11

def self.from_api(data)
  data = data.transform_keys(&:to_sym)
  new(
    id: data[:id],
    uuid: data[:uuid],
    name: data[:name],
    status: data[:status],
    folder_id: data[:folder_id],
    type: data[:type],
    creation_date: data[:creation_date],
    last_modification_date: data[:last_modification_date]
  )
end