Class: Obcd::Checks::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/obcd/checks/check.rb

Direct Known Subclasses

HeaderStyle

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Check

Returns a new instance of Check.



6
7
8
9
# File 'lib/obcd/checks/check.rb', line 6

def initialize(filename)
  @filename = filename
  @violations = []
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



4
5
6
# File 'lib/obcd/checks/check.rb', line 4

def filename
  @filename
end

#violationsObject

Returns the value of attribute violations.



4
5
6
# File 'lib/obcd/checks/check.rb', line 4

def violations
  @violations
end

Class Method Details

.check(filename) ⇒ Object



15
16
17
18
19
# File 'lib/obcd/checks/check.rb', line 15

def self.check(filename)
  instance = new(filename)
  instance.check!
  instance.violations
end

Instance Method Details

#check!Object



11
12
13
# File 'lib/obcd/checks/check.rb', line 11

def check!
  # implement in a child class
end