Class: CBETA::XMLDocument
- Inherits:
-
Object
- Object
- CBETA::XMLDocument
- Defined in:
- lib/cbeta/xml_document.rb
Constant Summary collapse
- PASS =
%w(back graphic mulu rdg sic teiHeader)
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
-
#initialize(string_or_io) ⇒ XMLDocument
constructor
A new instance of XMLDocument.
- #to_text ⇒ Object
Constructor Details
#initialize(string_or_io) ⇒ XMLDocument
Returns a new instance of XMLDocument.
8 9 10 11 12 |
# File 'lib/cbeta/xml_document.rb', line 8 def initialize(string_or_io) @doc = Nokogiri::XML(string_or_io) @doc.remove_namespaces! @gaiji = CBETA::Gaiji.new end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
6 7 8 |
# File 'lib/cbeta/xml_document.rb', line 6 def doc @doc end |
Instance Method Details
#to_text ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cbeta/xml_document.rb', line 14 def to_text @format = 'text' @gaiji_norm = [true] @next_line_buf = '' traverse(@doc.root) end |