Class: AttachFileCommandResult
- Inherits:
-
AbstractCommandResult
- Object
- AbstractCommandResult
- AttachFileCommandResult
- Defined in:
- lib/audit/lib/parser/command/attach_file_command.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Attributes inherited from AbstractCommandResult
#check, #message, #severity, #type
Instance Method Summary collapse
-
#initialize(check, severity, message, file) ⇒ AttachFileCommandResult
constructor
A new instance of AttachFileCommandResult.
- #to_hash ⇒ Object
- #to_string ⇒ Object
Methods inherited from AbstractCommandResult
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, , file) super(check, severity, , ResultType::FILE) @file = file end |
Instance Attribute Details
#file ⇒ Object (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_hash ⇒ Object
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_string ⇒ Object
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 |