Class: TeamCymru::MalwareResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/teamcymru/malware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, timestamp, percent_detect) ⇒ MalwareResult

Returns a new instance of MalwareResult.



6
7
8
9
10
# File 'lib/teamcymru/malware.rb', line 6

def initialize(hash, timestamp, percent_detect)
  self.hash = hash
  self.timestamp = Time.at(timestamp.to_i)
  self.percent_detect = (percent_detect == "NO_DATA") ? 0 : percent_detect.to_i
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash

Returns:

  • (Object)

    the current value of hash



5
6
7
# File 'lib/teamcymru/malware.rb', line 5

def hash
  @hash
end

#percent_detectObject

Returns the value of attribute percent_detect

Returns:

  • (Object)

    the current value of percent_detect



5
6
7
# File 'lib/teamcymru/malware.rb', line 5

def percent_detect
  @percent_detect
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



5
6
7
# File 'lib/teamcymru/malware.rb', line 5

def timestamp
  @timestamp
end