Class: HDLRuby::High::Std::Board::DIGIT

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

Overview

Class describing a digit display.

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



66
67
68
# File 'lib/HDLRuby/ui/hruby_board.rb', line 66

def hread
  @hread
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



66
67
68
# File 'lib/HDLRuby/ui/hruby_board.rb', line 66

def id
  @id
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



66
67
68
# File 'lib/HDLRuby/ui/hruby_board.rb', line 66

def size
  @size
end

Instance Method Details

#to_htmlObject



67
68
69
70
71
72
73
74
# File 'lib/HDLRuby/ui/hruby_board.rb', line 67

def to_html
  return '<div class="digitset" id=' + self.id.to_s +
        ' data-width="' + self.size.to_s + '" data-value="0" >' +
      '<span class="name">' + self.hread.to_s + '</span>' +
      '<span>&nbsp;&nbsp;</span>' + 
      '<span class="matrix">' + "&nbsp;"*self.size + '</span>' +
    "</div>\\n" 
end