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



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[:id]
  @sharing_group_id = attributes[:sharing_group_id]
  @org_id = attributes[:org_id]
  @extend = attributes[:extend]

  @organization = build_attribute(item: attributes[:Organization], klass: Org)
end

Instance Attribute Details

#extendString (readonly)



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

def extend
  @extend
end

#idString (readonly)



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

def id
  @id
end

#org_idString (readonly)



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

def org_id
  @org_id
end

#organizationMISP::Organization? (readonly)



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

def organization
  @organization
end

#sharing_group_idString (readonly)



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.



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