Class: Ncurses::WINDOW
- Inherits:
-
Object
- Object
- Ncurses::WINDOW
- Includes:
- Destroy_checker
- Defined in:
- lib/ncurses_sugar.rb
Class Method Summary collapse
Instance Method Summary collapse
- #del ⇒ Object (also: #delete)
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to?(name) ⇒ Boolean
Methods included from Destroy_checker
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ncurses_sugar.rb', line 60 def method_missing(name, *args, &block) 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, &block) end end test_name = "w" + name if (Ncurses.respond_to?(test_name)) return Ncurses.send(test_name, self, *args, &block) end Ncurses.send(name, self, *args, &block) end |
Class Method Details
.new(*args) ⇒ Object
86 87 88 |
# File 'lib/ncurses_sugar.rb', line 86 def WINDOW.new(*args) Ncurses.newwin(*args) end |
Instance Method Details
#del ⇒ Object Also known as: delete
82 83 84 |
# File 'lib/ncurses_sugar.rb', line 82 def del Ncurses.delwin(self) end |
#respond_to?(name) ⇒ Boolean
75 76 77 78 79 80 81 |
# File 'lib/ncurses_sugar.rb', line 75 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 |