Class: CI::Syntax::Tool::Result::FileResult

Inherits:
CI::Syntax::Tool::Result show all
Defined in:
lib/ci-syntax-tool/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileResult

Returns a new instance of FileResult.



103
104
105
106
107
# File 'lib/ci-syntax-tool/result.rb', line 103

def initialize(path)
  @path = path
  @whole_file_processed = false
  @issues = []
end

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



101
102
103
# File 'lib/ci-syntax-tool/result.rb', line 101

def issues
  @issues
end

#pathObject (readonly)

Returns the value of attribute path.



100
101
102
# File 'lib/ci-syntax-tool/result.rb', line 100

def path
  @path
end

Instance Method Details

#add_issue(opts) ⇒ Object



109
110
111
# File 'lib/ci-syntax-tool/result.rb', line 109

def add_issue(opts)
  issues << Issue.new(opts)
end

#error_countObject



117
118
119
# File 'lib/ci-syntax-tool/result.rb', line 117

def error_count
  errors.count
end

#errorsObject



125
126
127
# File 'lib/ci-syntax-tool/result.rb', line 125

def errors 
  issues.select { |i| i.level == :error }
end

#warning_countObject



113
114
115
# File 'lib/ci-syntax-tool/result.rb', line 113

def warning_count
  warnings.count
end

#warningsObject



121
122
123
# File 'lib/ci-syntax-tool/result.rb', line 121

def warnings 
  issues.select { |i| i.level == :warning }
end