Class: MISP::GalaxyCluster

Inherits:
Base
  • Object
show all
Defined in:
lib/misp/galaxy_cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ GalaxyCluster

Returns a new instance of GalaxyCluster.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/misp/galaxy_cluster.rb', line 28

def initialize(**attributes)
  attributes = normalize_attributes(attributes)

  @id = attributes.dig(:id)
  @uuid = attributes.dig(:uuid)
  @type = attributes.dig(:type)
  @value = attributes.dig(:value)
  @tag_name = attributes.dig(:tag_name)
  @description = attributes.dig(:description)
  @galaxy_id = attributes.dig(:galaxy_id)
  @source = attributes.dig(:source)
  @authors = attributes.dig(:authors)
  @tag_id = attributes.dig(:tag_id)
  @meta = attributes.dig(:meta)
end

Instance Attribute Details

#authorsArray<String> (readonly)

Returns:

  • (Array<String>)


22
23
24
# File 'lib/misp/galaxy_cluster.rb', line 22

def authors
  @authors
end

#descriptionString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/misp/galaxy_cluster.rb', line 16

def description
  @description
end

#galaxy_idString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/misp/galaxy_cluster.rb', line 18

def galaxy_id
  @galaxy_id
end

#idString (readonly)

Returns:

  • (String)


6
7
8
# File 'lib/misp/galaxy_cluster.rb', line 6

def id
  @id
end

#metaHash (readonly)

Returns:

  • (Hash)


26
27
28
# File 'lib/misp/galaxy_cluster.rb', line 26

def meta
  @meta
end

#sourceString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/misp/galaxy_cluster.rb', line 20

def source
  @source
end

#tag_idString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/misp/galaxy_cluster.rb', line 24

def tag_id
  @tag_id
end

#tag_nameString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/misp/galaxy_cluster.rb', line 14

def tag_name
  @tag_name
end

#typeString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/misp/galaxy_cluster.rb', line 10

def type
  @type
end

#uuidString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/misp/galaxy_cluster.rb', line 8

def uuid
  @uuid
end

#valueString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/misp/galaxy_cluster.rb', line 12

def value
  @value
end

Instance Method Details

#to_hHash

Returns a hash representation of the attribute data.

Returns:

  • (Hash)


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/misp/galaxy_cluster.rb', line 49

def to_h
  {
    id: id,
    uuid: uuid,
    type: type,
    value: value,
    tag_name: tag_name,
    description: description,
    galaxy_id: galaxy_id,
    source: source,
    authors: authors,
    tag_id: tag_id,
    meta: meta,
  }.compact
end