Class: AttachFileCommandResult

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

Instance Attribute Summary collapse

Attributes inherited from AbstractCommandResult

#check, #message, #severity, #type

Instance Method Summary collapse

Methods inherited from AbstractCommandResult

#visible?

Constructor Details

#initialize(check, severity, message, file) ⇒ AttachFileCommandResult

Returns a new instance of AttachFileCommandResult.



9
10
11
12
# File 'lib/audit/lib/parser/command/attach_file_command.rb', line 9

def initialize(check, severity, message, file)
  super(check, severity, message, ResultType::FILE)
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/audit/lib/parser/command/attach_file_command.rb', line 7

def file
  @file
end

Instance Method Details

#to_hashObject



22
23
24
# File 'lib/audit/lib/parser/command/attach_file_command.rb', line 22

def to_hash()
  return super.to_hash().merge({:file => file})
end

#to_stringObject



14
15
16
17
18
19
20
# File 'lib/audit/lib/parser/command/attach_file_command.rb', line 14

def to_string()
  if @message then
    return "#{@message}: #{@file}"
  else
    return "See attached file #{@file}"
  end
end