Sha256: a6add9c78ace9b8019cf635a238c4613edb4c5efbab1705f8df0edc6cf64e758

Contents?: true

Size: 528 Bytes

Versions: 7

Compression:

Stored size: 528 Bytes

Contents

module XML
  module Smart
    class Dom

      class Text
        def initialize(text); @node = text; end

        def ===(cls); self.is_a? cls; end

        def dump; to_s; end
        def to_s; @node.content.to_s; end
        def to_f; @node.content.to_f; end
        def to_i; @node.content.to_i; end

        def text; @node.content; end
        def text=(t); @node.content = t.to_s if t.respond_to? :to_s; end

        def parent; Node.new(@node.parent); end

        def path; @node.path; end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xml-smart-0.5.3 lib/xml/smart_domtext.rb
xml-smart-0.5.2 lib/xml/smart_domtext.rb
xml-smart-0.5.1 lib/xml/smart_domtext.rb
xml-smart-0.5.0 lib/xml/smart_domtext.rb
xml-smart-0.4.4 lib/xml/smart_domtext.rb
xml-smart-0.4.3 lib/xml/smart_domtext.rb
xml-smart-0.4.2 lib/xml/smart_domtext.rb