Class: AbstractIndex

Inherits:
Object show all
Includes:
EmacsLispString, FilenameString, KanjiConverter, LocalVariables, MkArray
Defined in:
lib/langhelp/langhelp-base.rb

Overview

Abstract class of information index

Constant Summary collapse

SPACES =
"\t"

Constants included from LocalVariables

LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END

Constants included from KanjiConverter

KanjiConverter::KCONVERTERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LocalVariables

#insert_local_variables

Methods included from FilenameString

#abbreviate_filename, #abbreviate_filename!, #normalize_filename!

Methods included from KanjiConverter

#encoding, #kconv

Methods included from MkArray

#mkarray

Methods included from EmacsLispString

#lisp_dump_string

Constructor Details

#initialize(x = {}) ⇒ AbstractIndex

Returns a new instance of AbstractIndex.



147
148
149
150
151
152
# File 'lib/langhelp/langhelp-base.rb', line 147

def initialize(x={})
  @title = x[:title]
  @arg1 = x[self.class.to_s.intern]
  @conf = x[:conf]
  init x
end

Instance Attribute Details

#arg1Object (readonly)

1st parameter ie. the key is a symbol of class name



160
161
162
# File 'lib/langhelp/langhelp-base.rb', line 160

def arg1
  @arg1
end

#confObject

Hash specified by configuration file.



163
164
165
# File 'lib/langhelp/langhelp-base.rb', line 163

def conf
  @conf
end

#titleObject

The title of the index.



166
167
168
# File 'lib/langhelp/langhelp-base.rb', line 166

def title
  @title
end

Instance Method Details

#init(x = {}) ⇒ Object

Initialize for subclass. Do not process files! only do initialization.



156
157
# File 'lib/langhelp/langhelp-base.rb', line 156

def init(x={})
end

#output_title(io) ⇒ Object



172
173
174
175
176
# File 'lib/langhelp/langhelp-base.rb', line 172

def output_title(io)
  if title
    io.puts "#### #{ANCHOR_BEGIN}#{title}#{ANCHOR_END} ####"
  end
end

#to_e(io) ⇒ Object

Dump into e-script



179
180
# File 'lib/langhelp/langhelp-base.rb', line 179

def to_e(io)
end