Class: HDLRuby::High::Std::Board::LED

Inherits:
Struct
  • Object
show all
Defined in:
lib/HDLRuby/ui/hruby_board.rb

Overview

Class describing a row of LEDs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hreadObject

Returns the value of attribute hread

Returns:

  • (Object)

    the current value of hread



54
55
56
# File 'lib/HDLRuby/ui/hruby_board.rb', line 54

def hread
  @hread
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



54
55
56
# File 'lib/HDLRuby/ui/hruby_board.rb', line 54

def id
  @id
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



54
55
56
# File 'lib/HDLRuby/ui/hruby_board.rb', line 54

def size
  @size
end

Instance Method Details

#to_htmlObject



55
56
57
58
59
60
61
62
# File 'lib/HDLRuby/ui/hruby_board.rb', line 55

def to_html
  return "<div class=\"ledset\" id=\"#{self.id}\" data-value=\"0\">\\n" +
    '<span class="name">' + self.hread.to_s + '</span>' +
    '<span>&nbsp;&nbsp;</span>' + 
    self.size.times.map do |i|
      '<i class="led" class="led_off"></i>\n'
    end.join + "</div>\\n"
end