Class: Yalphabetize::FileYalphabetizer
- Inherits:
-
Object
- Object
- Yalphabetize::FileYalphabetizer
- Defined in:
- lib/yalphabetize/file_yalphabetizer.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file_path, **options) ⇒ FileYalphabetizer
constructor
A new instance of FileYalphabetizer.
Constructor Details
#initialize(file_path, **options) ⇒ FileYalphabetizer
Returns a new instance of FileYalphabetizer.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/yalphabetize/file_yalphabetizer.rb', line 5 def initialize(file_path, **) @file_path = file_path @reader_class = [:reader_class] @offence_detector_class = [:offence_detector_class] @logger = [:logger] @autocorrect = [:autocorrect] @alphabetizer_class = [:alphabetizer_class] @writer_class = [:writer_class] @order_checker_class = [:order_checker_class] end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/yalphabetize/file_yalphabetizer.rb', line 16 def call if offences? logger.log_offence(file_path) autocorrect_file if autocorrect else logger.log_no_offence end end |