Class: Ncurses::WINDOW

Inherits:
Object
  • Object
show all
Includes:
Destroy_checker
Defined in:
ext/ncurses/ncurses_wrap.c,
lib/ncurses.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Destroy_checker

#destroyed?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(name, *args)



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/ncurses.rb', line 62

def method_missing(name, *args)
  name = name.to_s
  if (name[0,2] == "mv")
    test_name = name.dup
    test_name[2,0] = "w" # insert "w" after"mv"
    if (Ncurses.respond_to?(test_name))
      return Ncurses.send(test_name, self, *args)
    end
  end
  test_name = "w" + name
  if (Ncurses.respond_to?(test_name))
    return Ncurses.send(test_name, self, *args)
  end
  Ncurses.send(name, self, *args)
end

Class Method Details

+ (Object) new(*args)



88
89
90
# File 'lib/ncurses.rb', line 88

def WINDOW.new(*args)
  Ncurses.newwin(*args)
end

Instance Method Details

- (Object) del Also known as: delete



84
85
86
# File 'lib/ncurses.rb', line 84

def del
  Ncurses.delwin(self)
end

- (Boolean) respond_to?(name)

Returns:

  • (Boolean)


77
78
79
80
81
82
83
# File 'lib/ncurses.rb', line 77

def respond_to?(name)
  name = name.to_s
  if (name[0,2] == "mv" && Ncurses.respond_to?("mvw" + name[2..-1]))
    return true
  end
  Ncurses.respond_to?("w" + name) || Ncurses.respond_to?(name)
end