Class: HDLRuby::High::Std::Board::HEXA

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

Overview

Class describing an hexadecimal 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



119
120
121
# File 'lib/HDLRuby/ui/hruby_board.rb', line 119

def hread
  @hread
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



119
120
121
# File 'lib/HDLRuby/ui/hruby_board.rb', line 119

def id
  @id
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



119
120
121
# File 'lib/HDLRuby/ui/hruby_board.rb', line 119

def size
  @size
end

Instance Method Details

#to_htmlObject



120
121
122
123
124
125
126
# File 'lib/HDLRuby/ui/hruby_board.rb', line 120

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