Class: MISP::Org
Instance Attribute Summary collapse
- #id ⇒ String readonly
- #name ⇒ String readonly
- #uuid ⇒ String readonly
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Org
constructor
A new instance of Org.
-
#to_h ⇒ Hash
Returns a hash representation of the attribute data.
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
#id ⇒ String (readonly)
6 7 8 |
# File 'lib/misp/org.rb', line 6 def id @id end |
#name ⇒ String (readonly)
8 9 10 |
# File 'lib/misp/org.rb', line 8 def name @name end |
#uuid ⇒ String (readonly)
10 11 12 |
# File 'lib/misp/org.rb', line 10 def uuid @uuid end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of the attribute data.
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 |