Class: OTX::Indicator::CVE::General

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

Instance Attribute Summary collapse

Attributes inherited from Type::Base

#created, #id, #modified

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ General

Returns a new instance of General.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/otx_ruby/types/cve.rb', line 10

def initialize(attributes={})
  attributes.each do |key, value|
    _key = key.gsub('-', '_')

    unless self.respond_to?(key)
      self.class.send(:attr_accessor, key)
    end

    if _key == 'pulse_info'
      @pulse_info = OTX::Indicator::CVE::PulseInfo.new(value)
    elsif _key == 'base_indicator'
      @base_indicator = OTX::Indicator::CVE::BaseIndicator.new(value)
    elsif _key == 'references'
      @references = []
      value.each do |reference|
        @references << OTX::Indicator::CVE::Reference.new(reference)
      end
    else
      send("#{_key.downcase}=", value)
    end
  end
end

Instance Attribute Details

#base_indicatorObject

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/cve.rb', line 8

def base_indicator
  @base_indicator
end

#date_modifiedObject

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/cve.rb', line 8

def date_modified
  @date_modified
end

#indicatorObject

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/cve.rb', line 8

def indicator
  @indicator
end

#pulse_infoObject

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/cve.rb', line 8

def pulse_info
  @pulse_info
end

#referencesObject

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/cve.rb', line 8

def references
  @references
end