Archived
1
0
Fork 0

Add events again

This commit is contained in:
Braiden Vasco 2017-07-25 15:05:52 +00:00
parent d891c2026e
commit 6c7a427780
2 changed files with 31 additions and 0 deletions

30
lib/events.rb Normal file
View file

@ -0,0 +1,30 @@
# frozen_string_literal: true
module Events
module Window
class Left; end
class Right; end
end
module Text
class Left; end
class Right; end
class Up; end
class Down; end
class Home; end
class End; end
class Backspace; end
class Delete; end
class Putc
attr_reader :char
def initialize(char)
raise TypeError, "expected char to be a #{String}" unless char.is_a? String
raise ArgumentError, 'expected char to have length 1' unless char.length == 1
@char = char.frozen? ? char : char.dup.freeze
end
end
end
end

View file

@ -3,6 +3,7 @@
require 'curses' require 'curses'
# Additional classes # Additional classes
require 'events'
require 'style' require 'style'
# Basic # Basic