rubyx-debugger/lib/base/constant_view.rb

20 lines
463 B
Ruby
Raw Normal View History

require_relative "element_view"
2015-10-07 11:24:02 +02:00
# A very simple ElementView with constant text and class. It uses the ElementView.div function
# to generate the html, see there for details
#
class ConstantView < ElementView
2015-10-07 11:24:02 +02:00
# store the class and text
def initialize class_or_id , text = nil
@class_or_id = class_or_id
@text = text
end
2015-10-07 11:24:02 +02:00
# use ElementView.div to create html from the class and text
def draw
@element = div(@class_or_id , @text)
end
end