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.



10
11
12
# File 'lib/plugins/pre_commit/domain/checkstyle.rb', line 10

def initialize(bad_files)
  @bad_files = bad_files
end

Instance Attribute Details

#bad_filesObject (readonly)

Returns the value of attribute bad_files.



8
9
10
# File 'lib/plugins/pre_commit/domain/checkstyle.rb', line 8

def bad_files
  @bad_files
end

Class Method Details

.goodObject

Factory for Checkstyle without errors



23
24
25
# File 'lib/plugins/pre_commit/domain/checkstyle.rb', line 23

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

Instance Method Details

#good?Boolean

A good checkstyle means no errors.

Returns:

  • (Boolean)


17
18
19
# File 'lib/plugins/pre_commit/domain/checkstyle.rb', line 17

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