From 8c8cae552c86ad634b51a42fe01a596955b4d4c0 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 14 Aug 2014 21:37:37 -0400 Subject: [PATCH] add Buffer ruby class --- runtime/lib/buffer.rb | 17 +++++++++++++++++ runtime/main.rb | 1 + 2 files changed, 18 insertions(+) create mode 100644 runtime/lib/buffer.rb diff --git a/runtime/lib/buffer.rb b/runtime/lib/buffer.rb new file mode 100644 index 0000000..9211b83 --- /dev/null +++ b/runtime/lib/buffer.rb @@ -0,0 +1,17 @@ +class Buffer + def initialize + @contents = [ + "Welcome to jes.", + "Press to exit (for now!)", + "0123456789", + ] + end + + def size + @contents.size + end + + def [](index) + @contents[index] + end +end diff --git a/runtime/main.rb b/runtime/main.rb index f96805d..41929e0 100644 --- a/runtime/main.rb +++ b/runtime/main.rb @@ -3,6 +3,7 @@ def init_loadpath end def load_lib_files + require "buffer" require "buffer_widget" require "gl" require "gl_program"