Method: MISP::Event#initialize

Defined in:
lib/misp/event.rb

#initialize(**attrs) ⇒ Event



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/misp/event.rb', line 60

def initialize(**attrs)
  attrs = normalize_attributes(**attrs)

  @id = attrs[:id]
  @orgc_id = attrs[:orgc_id]
  @org_id = attrs[:org_id]
  @date = attrs[:date]
  @threat_level_id = attrs[:threat_level_id]
  @info = attrs[:info]
  @published = attrs[:published] || false
  @uuid = attrs[:uuid]
  @attribute_count = attrs[:attribute_count]
  @analysis = attrs[:analysis]
  @timestamp = attrs[:timestamp]
  @distribution = attrs[:distribution]
  @proposal_email_lock = attrs[:proposal_email_lock]
  @locked = attrs[:locked] || false
  @publish_timestamp = attrs[:publish_timestamp]
  @sharing_group_id = attrs[:sharing_group_id]
  @disable_correlation = attrs[:disable_correlation]
  @event_creator_email = attrs[:event_creator_email]

  @org = build_attribute(item: attrs[:Org], klass: Org)
  @orgc = build_attribute(item: attrs[:Orgc], klass: Orgc)

  @sharing_groups = build_plural_attribute(items: attrs[:SharingGroup], klass: SharingGroup)
  @attributes = build_plural_attribute(items: attrs[:Attribute], klass: Attribute)
  @shadow_attributes = build_plural_attribute(items: attrs[:ShadowAttribute], klass: Attribute )
  @related_events = build_plural_attribute(items: attrs[:RelatedEvent], klass: Attribute)
  @galaxies = build_plural_attribute(items: attrs[:Galaxy], klass: Galaxy)
  @tags = build_plural_attribute(items: attrs[:Tag], klass: Tag)
end