Class: MISP::Org

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Org

Returns a new instance of Org.



12
13
14
15
16
17
18
# File 'lib/misp/org.rb', line 12

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

  @id = attributes.dig(:id)
  @name = attributes.dig(:name)
  @uuid = attributes.dig(:uuid)
end

Instance Attribute Details

#idString (readonly)

Returns:

  • (String)


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

def id
  @id
end

#nameString (readonly)

Returns:

  • (String)


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

def name
  @name
end

#uuidString (readonly)

Returns:

  • (String)


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

def uuid
  @uuid
end

Instance Method Details

#to_hHash

Returns a hash representation of the attribute data.

Returns:

  • (Hash)


25
26
27
28
29
30
31
# File 'lib/misp/org.rb', line 25

def to_h
  {
    id: id,
    name: name,
    uuid: uuid,
  }.compact
end