Ruby 3.1 リファレンスマニュアル > ライブラリ一覧 > rexml/documentライブラリ > REXML::Commentクラス > node_type
node_type -> Symbol
シンボル :comment を返します。