Class: HDLRuby::High::Std::Board::SLIDER
- Inherits:
-
Struct
- Object
- Struct
- HDLRuby::High::Std::Board::SLIDER
- Defined in:
- lib/HDLRuby/ui/hruby_board.rb
Overview
Class describing an "analog" slide switch.
Instance Attribute Summary collapse
-
#hwrite ⇒ Object
Returns the value of attribute hwrite.
-
#id ⇒ Object
Returns the value of attribute id.
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
Instance Method Summary collapse
Instance Attribute Details
#hwrite ⇒ Object
Returns the value of attribute hwrite
58 59 60 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 58 def hwrite @hwrite end |
#id ⇒ Object
Returns the value of attribute id
58 59 60 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 58 def id @id end |
#max ⇒ Object
Returns the value of attribute max
58 59 60 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 58 def max @max end |
#min ⇒ Object
Returns the value of attribute min
58 59 60 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 58 def min @min end |
Instance Method Details
#to_html ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 59 def to_html # Prepare the min, max and blank strings. min = self.min.to_s max = self.max.to_s return "<div class=\"sliderset\" id=\"#{self.id}\" data-value=\"0\">\\n" + '<span class="name">' + self.hwrite.to_s.chop + '</span>' + '<span> </span>' + '<input type="range" min="' + min + '" max="' + max + '" value="' + min + '" ' + 'class="slider" oninput="slider_change(this)">' + "</div>\\n" end |