Class: FileChecker
- Inherits:
-
Object
- Object
- FileChecker
- Defined in:
- lib/file_checker.rb
Instance Attribute Summary collapse
-
#error_msg ⇒ Object
Returns the value of attribute error_msg.
-
#header_path ⇒ Object
Returns the value of attribute header_path.
-
#implementation_path ⇒ Object
Returns the value of attribute implementation_path.
-
#path_ok ⇒ Object
Returns the value of attribute path_ok.
-
#path_to_check ⇒ Object
Returns the value of attribute path_to_check.
Instance Method Summary collapse
- #check_file_path ⇒ Object
-
#initialize(path) ⇒ FileChecker
constructor
A new instance of FileChecker.
Constructor Details
#initialize(path) ⇒ FileChecker
Returns a new instance of FileChecker.
4 5 6 7 8 9 10 |
# File 'lib/file_checker.rb', line 4 def initialize(path) @path_to_check = path @header_path = path @implementation_path = nil @error_msg = [] @path_ok = true end |
Instance Attribute Details
#error_msg ⇒ Object
Returns the value of attribute error_msg.
2 3 4 |
# File 'lib/file_checker.rb', line 2 def error_msg @error_msg end |
#header_path ⇒ Object
Returns the value of attribute header_path.
2 3 4 |
# File 'lib/file_checker.rb', line 2 def header_path @header_path end |
#implementation_path ⇒ Object
Returns the value of attribute implementation_path.
2 3 4 |
# File 'lib/file_checker.rb', line 2 def implementation_path @implementation_path end |
#path_ok ⇒ Object
Returns the value of attribute path_ok.
2 3 4 |
# File 'lib/file_checker.rb', line 2 def path_ok @path_ok end |
#path_to_check ⇒ Object
Returns the value of attribute path_to_check.
2 3 4 |
# File 'lib/file_checker.rb', line 2 def path_to_check @path_to_check end |
Instance Method Details
#check_file_path ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/file_checker.rb', line 12 def check_file_path unless valid_header_file? @path_ok = false @error_msg << "This is not a header file." end unless valid_implementation_file? @path_ok = false @error_msg << "There is no implementation file for this header file." end end |