Class: OTX::Indicator::CVE::PulseInfo

Inherits:
Type::Base
  • Object
show all
Defined in:
lib/otx_ruby/types/pulse_info.rb

Instance Attribute Summary

Attributes inherited from Type::Base

#created, #id, #modified

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PulseInfo

Returns a new instance of PulseInfo.



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

def initialize(attributes={})
  attributes.each do |key, value|
    unless self.respond_to?(key)
      self.class.send(:attr_accessor, key)
    end

    if key != 'pulses'
      send("#{key.downcase}=", value)
    else
      @pulses = []
      value.each do |pulse|
        @pulses << OTX::Pulse.new(pulse)
      end
    end
  end
end