Class: DataCommandResult
- Inherits:
-
AbstractCommandResult
- Object
- AbstractCommandResult
- DataCommandResult
- Defined in:
- lib/audit/lib/parser/command/data_command.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from AbstractCommandResult
#check, #message, #severity, #type
Instance Method Summary collapse
-
#initialize(check, severity, key, value) ⇒ DataCommandResult
constructor
A new instance of DataCommandResult.
- #to_hash ⇒ Object
- #to_string ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(check, severity, key, value) ⇒ DataCommandResult
Returns a new instance of DataCommandResult.
10 11 12 13 14 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 10 def initialize(check, severity, key, value) super(check, severity, "custom check data", ResultType::DATA) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 7 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 8 def value @value end |
Instance Method Details
#to_hash ⇒ Object
20 21 22 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 20 def to_hash() return super.to_hash().merge({:key => @key, :value => @value}) end |
#to_string ⇒ Object
16 17 18 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 16 def to_string() return "[" + @key + "] = " + @value end |
#visible? ⇒ Boolean
24 25 26 |
# File 'lib/audit/lib/parser/command/data_command.rb', line 24 def visible? return true end |