Sha256: 4caba9b826252b6212b95d4d6cdfbc51f2595fa5413c866abe233595890dde4b

Contents?: true

Size: 408 Bytes

Versions: 4

Compression:

Stored size: 408 Bytes

Contents

require_relative 'PromptAction.rb'

#noinspection RubyResolve
module PPCurses

  class GetIntegerAction < PromptAction

    def execute
     y = @win.cury()
     @data = ''
     begin 
       @win.setpos(y,x_padding())
       @win.clrtoeol()
       @win.box('|', '-')
       @win.addstr(@prompt)
       echo
       @data = @win.getstr()
       noecho
     end while not @data =~ /^\d+$/ 
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ppcurses-0.0.24 lib/ppcurses/actions/GetIntegerAction.rb
ppcurses-0.0.23 lib/ppcurses/actions/GetIntegerAction.rb
ppcurses-0.0.22 lib/ppcurses/actions/GetIntegerAction.rb
ppcurses-0.0.21 lib/ppcurses/actions/GetIntegerAction.rb