Class: Mihari::Artifact
- Inherits:
-
Object
- Object
- Mihari::Artifact
- Defined in:
- lib/mihari/artifact.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #data_type ⇒ String?
-
#initialize(data, message: nil) ⇒ Artifact
constructor
A new instance of Artifact.
- #message ⇒ String
- #to_h ⇒ Hash
- #valid? ⇒ true, false
Constructor Details
#initialize(data, message: nil) ⇒ Artifact
Returns a new instance of Artifact.
11 12 13 14 |
# File 'lib/mihari/artifact.rb', line 11 def initialize(data, message: nil) @data = data = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/mihari/artifact.rb', line 5 def data @data end |
Instance Method Details
#data_type ⇒ String?
17 18 19 |
# File 'lib/mihari/artifact.rb', line 17 def data_type TypeChecker.type data end |
#message ⇒ String
22 23 24 |
# File 'lib/mihari/artifact.rb', line 22 def @mesasge || data end |
#to_h ⇒ Hash
32 33 34 |
# File 'lib/mihari/artifact.rb', line 32 def to_h { data: data, data_type: data_type, message: } end |
#valid? ⇒ true, false
27 28 29 |
# File 'lib/mihari/artifact.rb', line 27 def valid? !data_type.nil? end |