Class: HDLRuby::High::Std::Board::TEXT

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

Overview

Class describing a text-based input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hwriteObject

Returns the value of attribute hwrite

Returns:

  • (Object)

    the current value of hwrite



74
75
76
# File 'lib/HDLRuby/ui/hruby_board.rb', line 74

def hwrite
  @hwrite
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



74
75
76
# File 'lib/HDLRuby/ui/hruby_board.rb', line 74

def id
  @id
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



74
75
76
# File 'lib/HDLRuby/ui/hruby_board.rb', line 74

def size
  @size
end

Instance Method Details

#to_htmlObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/HDLRuby/ui/hruby_board.rb', line 75

def to_html
  return "<div class=\"textset\" id=\"#{self.id}\" data-value=\"0\">\\n" + 
    '<form onSubmit="text_submit(this); return false">\\n' +
    '<span class="name">' + self.hwrite.to_s.chop + '</span>' +
    '<span>&nbsp;&nbsp;</span>' + 
       '<input class="matrix_in" type="text" name="text" ' +
         'placeholder="Enter an expression">' +
    "</form>\\n" +
  "</div>\\n"
end