Class: Necropsy::RejectedTarget
- Inherits:
-
Data
- Object
- Data
- Necropsy::RejectedTarget
- Defined in:
- lib/necropsy/models.rb
Instance Attribute Summary collapse
-
#definition_id ⇒ Object
readonly
Returns the value of attribute definition_id.
-
#evidence_ids ⇒ Object
readonly
Returns the value of attribute evidence_ids.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(definition_id:, reason:, evidence_ids: []) ⇒ RejectedTarget
constructor
A new instance of RejectedTarget.
- #to_h ⇒ Object
Constructor Details
#initialize(definition_id:, reason:, evidence_ids: []) ⇒ RejectedTarget
Returns a new instance of RejectedTarget.
133 134 135 136 137 138 |
# File 'lib/necropsy/models.rb', line 133 def initialize(definition_id:, reason:, evidence_ids: []) definition_id = ModelNormalization.identifier(definition_id, 'definition_id') reason = ModelNormalization.identifier(reason, 'reason') evidence_ids = ModelNormalization.string_list(evidence_ids, 'evidence_id') super end |
Instance Attribute Details
#definition_id ⇒ Object (readonly)
Returns the value of attribute definition_id
132 133 134 |
# File 'lib/necropsy/models.rb', line 132 def definition_id @definition_id end |
#evidence_ids ⇒ Object (readonly)
Returns the value of attribute evidence_ids
132 133 134 |
# File 'lib/necropsy/models.rb', line 132 def evidence_ids @evidence_ids end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
132 133 134 |
# File 'lib/necropsy/models.rb', line 132 def reason @reason end |
Class Method Details
.from_h(attributes) ⇒ Object
140 141 142 143 144 145 146 147 |
# File 'lib/necropsy/models.rb', line 140 def self.from_h(attributes) data = ModelNormalization.attributes(attributes, name) new( definition_id: data.fetch('definition_id'), reason: data.fetch('reason'), evidence_ids: data.fetch('evidence_ids', []) ) end |
Instance Method Details
#to_h ⇒ Object
149 150 151 152 153 154 155 |
# File 'lib/necropsy/models.rb', line 149 def to_h { 'definition_id' => definition_id, 'reason' => reason, 'evidence_ids' => evidence_ids } end |