Module: ScripTTY::Term

Defined in:
lib/scriptty/term.rb,
lib/scriptty/term/dg410.rb,
lib/scriptty/term/xterm.rb,
lib/scriptty/term/dg410/parser.rb

Defined Under Namespace

Classes: DG410, XTerm

Constant Summary collapse

TERMINAL_TYPES =
{
  "dg410" => {:require => "scriptty/term/dg410", :class_name => "::ScripTTY::Term::DG410"},
  "xterm" => {:require => "scriptty/term/xterm", :class_name => "::ScripTTY::Term::XTerm"},
}

Class Method Summary collapse

Class Method Details

.class_by_name(name) ⇒ Object

Load the specified terminal class by name



32
33
34
35
36
37
# File 'lib/scriptty/term.rb', line 32

def self.class_by_name(name)
  tt = TERMINAL_TYPES[name]
  return nil unless tt
  require tt[:require]
  eval(tt[:class_name])
end

.new(name, *args, &block) ⇒ Object

Load and instantiate the specified terminal by name



27
28
29
# File 'lib/scriptty/term.rb', line 27

def self.new(name, *args, &block)
  self.class_by_name(name).new(*args, &block)
end