Class: Domain::Checkstyle

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/pre-commit/domain/checkstyle.rb

Overview

Represents the Checkstyle

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bad_files) ⇒ Checkstyle

Returns a new instance of Checkstyle.



8
9
10
# File 'lib/plugins/pre-commit/domain/checkstyle.rb', line 8

def initialize(bad_files)
  @bad_files = bad_files
end

Instance Attribute Details

#bad_filesObject (readonly)

Returns the value of attribute bad_files.



6
7
8
# File 'lib/plugins/pre-commit/domain/checkstyle.rb', line 6

def bad_files
  @bad_files
end

Class Method Details

.goodObject

Factory for Checkstyle without errors



21
22
23
# File 'lib/plugins/pre-commit/domain/checkstyle.rb', line 21

def self.good
  Domain::Checkstyle.new(nil)
end

Instance Method Details

#good?Boolean

A good checkstyle means no errors.

Returns:

  • (Boolean)


15
16
17
# File 'lib/plugins/pre-commit/domain/checkstyle.rb', line 15

def good?
  @bad_files.nil? || @bad_files.empty?
end