Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/events.rb

31 lines
650 B
Ruby
Raw Normal View History

2017-07-25 11:05:52 -04:00
# 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