Class: OTX::Indicator::IP::Malware

Inherits:
Type::Base show all
Defined in:
lib/otx_ruby/types/ip/malware.rb

Instance Attribute Summary

Attributes inherited from Type::Base

#created, #id, #modified

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Malware

Returns a new instance of Malware.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/otx_ruby/types/ip/malware.rb', line 5

def initialize(attributes={})
  attributes.each do |key, value|
    if key == 'hash'
      self.class.send(:attr_accessor, 'malware_hash')
      send('malware_hash=', value)
    else
      unless self.respond_to?(key)
        self.class.send(:attr_accessor, key)
      end
      send("#{key.downcase}=", value)
    end
  end
end