Class: Flammarion::Writeable::Paragraph
- Inherits:
-
Object
- Object
- Flammarion::Writeable::Paragraph
- Defined in:
- lib/cem/cflame/p.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(text, name, owner) ⇒ Paragraph
constructor
A new instance of Paragraph.
- #text=(newText) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(text, name, owner) ⇒ Paragraph
Returns a new instance of Paragraph.
9 10 11 12 13 |
# File 'lib/cem/cflame/p.rb', line 9 def initialize(text, name, owner) @text = text @name = name @owner = owner end |
Instance Method Details
#html ⇒ Object
15 16 17 |
# File 'lib/cem/cflame/p.rb', line 15 def html %|<p id="#{@name}">#{@text}</p>| end |
#text=(newText) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/cem/cflame/p.rb', line 23 def text=(newText) return if newText == @text @text = newText @owner.js("$( '##{@name}' ).replaceWith('#{html}');") end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/cem/cflame/p.rb', line 19 def to_s html end |