Class: MISP::SharingGroupOrg

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ SharingGroupOrg

Returns a new instance of SharingGroupOrg.



17
18
19
20
21
22
23
24
25
26
# File 'lib/misp/sharing_group_org.rb', line 17

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

  @id = attributes.dig(:id)
  @sharing_group_id = attributes.dig(:sharing_group_id)
  @org_id = attributes.dig(:org_id)
  @extend = attributes.dig(:extend)

  @organization = build_attribute(item: attributes.dig(:Organization), klass: Org)
end

Instance Attribute Details

#extendString (readonly)

Returns:

  • (String)


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

def extend
  @extend
end

#idString (readonly)

Returns:

  • (String)


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

def id
  @id
end

#org_idString (readonly)

Returns:

  • (String)


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

def org_id
  @org_id
end

#organizationMISP::Organization? (readonly)

Returns:

  • (MISP::Organization, nil)


15
16
17
# File 'lib/misp/sharing_group_org.rb', line 15

def organization
  @organization
end

#sharing_group_idString (readonly)

Returns:

  • (String)


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

def sharing_group_id
  @sharing_group_id
end

Instance Method Details

#to_hHash

Returns a hash representation of the attribute data.

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
41
42
# File 'lib/misp/sharing_group_org.rb', line 33

def to_h
  {
    erver: erver,
    id: id,
    sharing_group_id: sharing_group_id,
    org_id: org_id,
    extend: @extend,
    Organization: organization.to_h
  }.compact
end