Class: HDLRuby::High::Std::Board::BT
- Inherits:
-
Struct
- Object
- Struct
- HDLRuby::High::Std::Board::BT
- Defined in:
- lib/HDLRuby/ui/hruby_board.rb
Overview
Class describing a row of buttons.
Instance Attribute Summary collapse
-
#hwrite ⇒ Object
Returns the value of attribute hwrite.
-
#id ⇒ Object
Returns the value of attribute id.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
Instance Attribute Details
#hwrite ⇒ Object
Returns the value of attribute hwrite
40 41 42 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 40 def hwrite @hwrite end |
#id ⇒ Object
Returns the value of attribute id
40 41 42 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 40 def id @id end |
#size ⇒ Object
Returns the value of attribute size
40 41 42 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 40 def size @size end |
Instance Method Details
#to_html ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 41 def to_html return "<div class=\"btset\" id=\"#{self.id}\" data-value=\"0\">\\n" + '<span class="name">' + self.hwrite.to_s.chop + '</span>' + '<span> </span>' + self.size.times.map do |i| '<button class="bt" data-bit="' + (self.size-i-1).to_s + '" ' + 'onmousedown="bt_click(this)" onmouseup="bt_release(this)" onmouseleave="bt_release(this)"><i class="bt_off"></i></button>\n' end.join + "</div>\\n" end |