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.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/hachi/models/case.rb', line 15

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.



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

def description
  @description
end

#flagObject (readonly)

Returns the value of attribute flag.



11
12
13
# File 'lib/hachi/models/case.rb', line 11

def flag
  @flag
end

#ownerObject (readonly)

Returns the value of attribute owner.



10
11
12
# File 'lib/hachi/models/case.rb', line 10

def owner
  @owner
end

#severityObject (readonly)

Returns the value of attribute severity.



8
9
10
# File 'lib/hachi/models/case.rb', line 8

def severity
  @severity
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



9
10
11
# File 'lib/hachi/models/case.rb', line 9

def start_date
  @start_date
end

#tagsObject (readonly)

Returns the value of attribute tags.



13
14
15
# File 'lib/hachi/models/case.rb', line 13

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.



12
13
14
# File 'lib/hachi/models/case.rb', line 12

def tlp
  @tlp
end

Instance Method Details

#payloadObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/hachi/models/case.rb', line 32

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