Class: MISP::SharingGroupOrg
Instance Attribute Summary collapse
- #extend ⇒ String readonly
- #id ⇒ String readonly
- #org_id ⇒ String readonly
- #organization ⇒ MISP::Organization? readonly
- #sharing_group_id ⇒ String readonly
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ SharingGroupOrg
constructor
A new instance of SharingGroupOrg.
-
#to_h ⇒ Hash
Returns a hash representation of the attribute data.
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
#extend ⇒ String (readonly)
12 13 14 |
# File 'lib/misp/sharing_group_org.rb', line 12 def extend @extend end |
#id ⇒ String (readonly)
6 7 8 |
# File 'lib/misp/sharing_group_org.rb', line 6 def id @id end |
#org_id ⇒ String (readonly)
10 11 12 |
# File 'lib/misp/sharing_group_org.rb', line 10 def org_id @org_id end |
#organization ⇒ MISP::Organization? (readonly)
15 16 17 |
# File 'lib/misp/sharing_group_org.rb', line 15 def organization @organization end |
#sharing_group_id ⇒ String (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_h ⇒ Hash
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 |