Class: RubyJard::Screen

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_jard/screen.rb

Overview

A screen is a unit of information drawing on the terminal. Each screen is generated based on input layout specifiation, screen data, and top-left corner cordination.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(layout, session: nil) ⇒ Screen

Returns a new instance of Screen.



11
12
13
14
15
16
17
18
# File 'lib/ruby_jard/screen.rb', line 11

def initialize(layout, session: nil)
  @session = session || RubyJard::Session
  @layout = layout
  @window = []
  @cursor = nil
  @selected = 0
  @rows = []
end

Instance Attribute Details

#cursorObject

Returns the value of attribute cursor.



9
10
11
# File 'lib/ruby_jard/screen.rb', line 9

def cursor
  @cursor
end

#layoutObject

Returns the value of attribute layout.



9
10
11
# File 'lib/ruby_jard/screen.rb', line 9

def layout
  @layout
end

#rowsObject

Returns the value of attribute rows.



9
10
11
# File 'lib/ruby_jard/screen.rb', line 9

def rows
  @rows
end

#selectedObject

Returns the value of attribute selected.



9
10
11
# File 'lib/ruby_jard/screen.rb', line 9

def selected
  @selected
end

#windowObject

Returns the value of attribute window.



9
10
11
# File 'lib/ruby_jard/screen.rb', line 9

def window
  @window
end

Instance Method Details

#buildObject

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/ruby_jard/screen.rb', line 30

def build
  raise NotImplementedError, "#{self.class} should implement this method."
end

#click(relative_x, relative_y) ⇒ Object



28
# File 'lib/ruby_jard/screen.rb', line 28

def click(relative_x, relative_y); end

#move_downObject



20
# File 'lib/ruby_jard/screen.rb', line 20

def move_down; end

#move_upObject



22
# File 'lib/ruby_jard/screen.rb', line 22

def move_up; end

#page_downObject



26
# File 'lib/ruby_jard/screen.rb', line 26

def page_down; end

#page_upObject



24
# File 'lib/ruby_jard/screen.rb', line 24

def page_up; end