Class: Hachi::Models::Case

Inherits:
Base
  • Object
show all
Defined in:
lib/hachi/models/case.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, description:, severity: nil, start_date: nil, owner: nil, flag: nil, tlp: nil, tags: nil) ⇒ Case

Returns a new instance of Case.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hachi/models/case.rb', line 8

def initialize(title:, description:, severity: nil, start_date: nil, owner: nil, flag: nil, tlp: nil, tags: nil)
  @title = title
  @description = description
  @severity = severity
  @start_date = start_date
  @owner = owner
  @flag = flag
  @tlp = tlp
  @tags = tags

  validate_flag if flag
  validate_severity if severity
  validate_start_date if start_date
  validate_tags if tags
  validate_tlp if tlp
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def description
  @description
end

#flagObject (readonly)

Returns the value of attribute flag.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def flag
  @flag
end

#ownerObject (readonly)

Returns the value of attribute owner.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def owner
  @owner
end

#severityObject (readonly)

Returns the value of attribute severity.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def severity
  @severity
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def start_date
  @start_date
end

#tagsObject (readonly)

Returns the value of attribute tags.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def title
  @title
end

#tlpObject (readonly)

Returns the value of attribute tlp.



6
7
8
# File 'lib/hachi/models/case.rb', line 6

def tlp
  @tlp
end

Instance Method Details

#payloadObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hachi/models/case.rb', line 25

def payload
  {
    title: title,
    description: description,
    severity: severity,
    startDate: start_date,
    owner: owner,
    flag: flag,
    tlp: tlp,
    tags: tags
  }.compact
end