Class: Syntaxer::FileStatus
- Inherits:
-
Object
- Object
- Syntaxer::FileStatus
- Defined in:
- lib/syntaxer/file_status.rb
Overview
Contain filename, status of the syntax and list of errors
Constant Summary collapse
- @@error_files =
[]
- @@all_files =
[]
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_name, errors = []) ⇒ FileStatus
constructor
A new instance of FileStatus.
Constructor Details
#initialize(file_name, errors = []) ⇒ FileStatus
Returns a new instance of FileStatus.
11 12 13 14 15 |
# File 'lib/syntaxer/file_status.rb', line 11 def initialize(file_name, errors = []) @errors = errors @file_name = file_name @status = @errors.empty? ? :ok : :failed end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/syntaxer/file_status.rb', line 9 def errors @errors end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
9 10 11 |
# File 'lib/syntaxer/file_status.rb', line 9 def file_name @file_name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/syntaxer/file_status.rb', line 9 def status @status end |
Class Method Details
.all_files ⇒ Object
28 29 30 |
# File 'lib/syntaxer/file_status.rb', line 28 def all_files @@all_files end |
.build(file_name, errors = []) ⇒ Object
18 19 20 21 22 |
# File 'lib/syntaxer/file_status.rb', line 18 def build(file_name, errors = []) file_status = new(file_name, errors) @@all_files << file_status @@error_files << file_status unless errors.empty? end |
.error_files ⇒ Object
24 25 26 |
# File 'lib/syntaxer/file_status.rb', line 24 def error_files @@error_files end |