Class: Glimmer::Opal::Label
- Inherits:
-
Object
- Object
- Glimmer::Opal::Label
- Defined in:
- lib/glimmer/opal/label.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #dom ⇒ Object
-
#initialize(parent, args) ⇒ Label
constructor
A new instance of Label.
- #redraw ⇒ Object
Constructor Details
#initialize(parent, args) ⇒ Label
Returns a new instance of Label.
6 7 8 9 10 |
# File 'lib/glimmer/opal/label.rb', line 6 def initialize(parent, args) @parent = parent @args = args @parent.add_child(self) end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/glimmer/opal/label.rb', line 4 def text @text end |
Instance Method Details
#dom ⇒ Object
23 24 25 26 27 28 |
# File 'lib/glimmer/opal/label.rb', line 23 def dom label_text = @text @dom ||= DOM { label label_text } end |
#redraw ⇒ Object
17 18 19 20 21 |
# File 'lib/glimmer/opal/label.rb', line 17 def redraw old_dom = @dom @dom = nil old_dom.replace dom end |