Class: RubyText::Window::Menu2D::Vertical

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vlist) ⇒ Vertical

Returns a new instance of Vertical.



15
16
17
18
19
20
21
# File 'lib/menu.rb', line 15

def initialize(vlist)
  @header = vlist[0]
  @hash = vlist[1]
  @widest = @header.length
  @hash.each_pair {|k,v| puts "k = #{k.inspect}"; getch; @widest = [@widest, k.length].max }
  @height = @hash.size
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



14
15
16
# File 'lib/menu.rb', line 14

def hash
  @hash
end

#headerObject (readonly)

Returns the value of attribute header.



14
15
16
# File 'lib/menu.rb', line 14

def header
  @header
end

#heightObject (readonly)

Returns the value of attribute height.



14
15
16
# File 'lib/menu.rb', line 14

def height
  @height
end

#widestObject (readonly)

Returns the value of attribute widest.



14
15
16
# File 'lib/menu.rb', line 14

def widest
  @widest
end