File: document.rb

package info (click to toggle)
ruby-kdl 1.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: ruby: 6,667; yacc: 72; sh: 5; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 291 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module KDL
  class Document
    attr_accessor :nodes
    
    def initialize(nodes)
      @nodes = nodes
    end

    def to_s
      @nodes.map(&:to_s).join("\n") + "\n"
    end

    def ==(other)
      return false unless other.is_a?(Document)

      nodes == other.nodes
    end
  end
end