Class: Salticid::Interface::View

Inherits:
Object
  • Object
show all
Includes:
Resizeable
Defined in:
lib/salticid/interface/view.rb

Direct Known Subclasses

HostView, TabView

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Resizeable

#resize

Constructor Details

#initialize(interface, params = {}) ⇒ View

Returns a new instance of View.



8
9
10
11
12
13
14
15
16
# File 'lib/salticid/interface/view.rb', line 8

def initialize(interface, params = {})
  @interface = interface
  @height = params[:height] || Curses.lines
  @width = params[:width] || Curses.cols
  @top = params[:top] || 0
  @left = params[:left] || 0

  @window = Curses::Window.new @height, @width, @top, @left
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



6
7
8
# File 'lib/salticid/interface/view.rb', line 6

def height
  @height
end

#leftObject

Returns the value of attribute left.



6
7
8
# File 'lib/salticid/interface/view.rb', line 6

def left
  @left
end

#topObject

Returns the value of attribute top.



6
7
8
# File 'lib/salticid/interface/view.rb', line 6

def top
  @top
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'lib/salticid/interface/view.rb', line 6

def width
  @width
end

#windowObject

Returns the value of attribute window.



6
7
8
# File 'lib/salticid/interface/view.rb', line 6

def window
  @window
end

Instance Method Details

#hideObject



23
24
25
26
# File 'lib/salticid/interface/view.rb', line 23

def hide
  @hidden = true
  @window.clear
end

#showObject



33
34
35
36
# File 'lib/salticid/interface/view.rb', line 33

def show
  @hidden = false
  render
end