2015-08-22 02:23:53 +02:00
|
|
|
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
|
|
|
|
#
|
2015-08-22 02:23:53 +02:00
|
|
|
class ConstantView < ElementView
|
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
# store the class and text
|
2015-08-22 02:23:53 +02:00
|
|
|
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
|
2015-08-22 02:23:53 +02:00
|
|
|
def draw
|
|
|
|
@element = div(@class_or_id , @text)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|