File: rtvisitor.rb

package info (click to toggle)
rttool 1.0.3-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 256 kB
  • ctags: 356
  • sloc: ruby: 2,118; makefile: 21
file content (63 lines) | stat: -rwxr-xr-x 954 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/ruby
=begin
rtvisitor.rb
$Id: rtvisitor.rb 1531 2009-01-21 17:21:23Z rubikitch $
=end
require 'rt/rtparser'

module RT
  class RTVisitor
    def each_cell(ary)
      ary.each do |x|
        if x.class == RT::RTCell
          yield x
        end
      end
    end
    private :each_cell
    
    def initialize
    end
    attr_reader :rt, :header, :body, :caption
    attr_accessor :filename, :charcode
    
    def self.visit(parsed)
      self::new.visit(parsed)
    end

    def visit(parsed)
      @filename = @charset = nil
      @rt = parsed
      @header = @rt.header
      @body = @rt.body
      @caption = @rt.config['caption']

      setup + visit_Caption + visit_Header + visit_Body + teardown
    end
    
    def setup
      ""
    end
    
    def teardown
      ""
    end
    
    def visit_Caption
      ""
    end
    
    def visit_Header
      ""
    end
    
    def visit_Body
      ""
    end
  end
end