Sha256: 5369b57e8670c65c90eba8026a1a471a3b4b79396c6d94e99970679d0533f663

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

require 'vtd/xml/node/attributes'

module VTD
  module Xml
    class Node
      include Attributes

      attr_reader :name, :text

      def initialize(nav, auto_pilot, current)
        @nav        = nav
        @auto_pilot = auto_pilot
        @current    = current
        super
      end

      def name
        @name ||= @nav.to_string(@current)
      end

      def text
        @text ||= string_from_index @nav.get_text
      end

      private

      def string_from_index(index)
        @nav.to_normalized_string(index) if index != -1
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vtd-xml-0.0.1-java lib/vtd/xml/node.rb