lib/jkf/converter/csa.rb in jkf-0.4.1 vs lib/jkf/converter/csa.rb in jkf-0.4.2
- old
+ new
@@ -1,17 +1,18 @@
module Jkf::Converter
+ # CSA v2.2 Converter
class Csa < Base
VERSION = "2.2".freeze
+ protected
+
def convert_root(jkf)
result = version
result += convert_information(jkf["header"]) if jkf["header"]
result += convert_initial(jkf["initial"]) if jkf["initial"]
result += convert_moves(jkf["moves"]) if jkf["moves"]
result
end
-
- protected
def convert_information(header)
result = ""
if header["先手"] || header["下手"]
result += "N+" + (header.delete("先手") || header.delete("下手") || "") + "\n"