lib/ppcurses/actions/BaseAction.rb in ppcurses-0.0.20 vs lib/ppcurses/actions/BaseAction.rb in ppcurses-0.0.21

- old
+ new

@@ -1,40 +1,41 @@ -require "curses" +require 'curses' +#noinspection RubyResolve module PPCurses class BaseAction - def setWindow(win) + def set_window(win) @win = win end - def xPadding() - return self.winPadding() + def x_padding + self.win_padding() end - def winPadding() - return 2 + def win_padding + 2 end - def winWidth() - Curses.cols - winPadding() + def win_width + Curses.cols - win_padding() end - def winHeight() - Curses.lines - winPadding() + def win_height + Curses.lines - win_padding() end - def createWindow() - @win = Window.new( winHeight(), winWidth(), - winPadding()/2, winPadding()/2) + def create_window + @win = Window.new( win_height(), win_width(), + win_padding()/2, win_padding()/2) @win.clear - @win.box("|", "-") - @win.setpos(@win.cury()+1, xPadding() ) + @win.box('|', '-') + @win.setpos(@win.cury()+1, x_padding() ) end - def show() + def show if @win.nil? - self.createWindow() + self.create_window() end @win.refresh end