Class: Suite

Inherits:
Object show all
Defined in:
lib/langhelp/langhelp-base.rb

Overview

Composite: collects information indexes.

Instance Method Summary collapse

Constructor Details

#initialize(x = {}) ⇒ Suite

Returns a new instance of Suite.



622
623
624
625
# File 'lib/langhelp/langhelp-base.rb', line 622

def initialize(x={})
  @debug_mode = x[:debug_mode]
  @indexes = []
end

Instance Method Details

#<<(index) ⇒ Object

Add a index to suite.



628
629
630
# File 'lib/langhelp/langhelp-base.rb', line 628

def <<(index)
  @indexes << index
end

#to_e(io) ⇒ Object

Dump into e-script



633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/langhelp/langhelp-base.rb', line 633

def to_e(io)
  @indexes.each do |index|
    begin
      index.output_title(io)
      index.to_e(io)
    rescue
      $stderr.puts $!
      $stderr.puts $@ if @debug_mode
      $stderr.puts "Failed to write `#{index.title}'."
    end
  end
end