Class: CBETA::P5aChecker
- Inherits:
-
Object
- Object
- CBETA::P5aChecker
- Includes:
- CbetaShare
- Defined in:
- lib/cbeta/p5a_checker.rb
Overview
檢查 CBETA XML P5a
Instance Method Summary collapse
- #check ⇒ Object
- #check_file(fn) ⇒ Object
-
#initialize(xml_root: nil, figures: nil, log: nil) ⇒ P5aChecker
constructor
A new instance of P5aChecker.
Methods included from CbetaShare
Constructor Details
#initialize(xml_root: nil, figures: nil, log: nil) ⇒ P5aChecker
Returns a new instance of P5aChecker.
8 9 10 11 12 13 14 15 |
# File 'lib/cbeta/p5a_checker.rb', line 8 def initialize(xml_root: nil, figures: nil, log: nil) @gaijis = CBETA::Gaiji.new @xml_root = xml_root @figures = figures @log = log @errors = '' @g_errors = {} end |
Instance Method Details
#check ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cbeta/p5a_checker.rb', line 17 def check puts "xml: #{@xml_root}" each_canon(@xml_root) do |c| @canon = c path = File.join(@xml_root, @canon) handle_canon(path) end display_errors end |
#check_file(fn) ⇒ Object
28 29 30 31 |
# File 'lib/cbeta/p5a_checker.rb', line 28 def check_file(fn) handle_file(fn) display_errors end |