Class: RubyText::Window::Menu2D::Vertical
- Inherits:
-
Object
- Object
- RubyText::Window::Menu2D::Vertical
- Defined in:
- lib/menu.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#widest ⇒ Object
readonly
Returns the value of attribute widest.
Instance Method Summary collapse
-
#initialize(vlist) ⇒ Vertical
constructor
A new instance of Vertical.
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
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
14 15 16 |
# File 'lib/menu.rb', line 14 def hash @hash end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
14 15 16 |
# File 'lib/menu.rb', line 14 def header @header end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
14 15 16 |
# File 'lib/menu.rb', line 14 def height @height end |
#widest ⇒ Object (readonly)
Returns the value of attribute widest.
14 15 16 |
# File 'lib/menu.rb', line 14 def widest @widest end |