Class: DataCommandResult

Inherits:
AbstractCommandResult show all
Defined in:
lib/audit/lib/parser/command/data_command.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractCommandResult

#check, #message, #severity, #type

Instance Method Summary collapse

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

#keyObject (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

#valueObject (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_hashObject



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_stringObject



16
17
18
# File 'lib/audit/lib/parser/command/data_command.rb', line 16

def to_string()
  return "[" + @key + "] = " + @value
end

#visible?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/audit/lib/parser/command/data_command.rb', line 24

def visible?
  return true
end