Class: CssTidy::Comment
Instance Attribute Summary collapse
-
#printable ⇒ Object
Returns the value of attribute printable.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #<<(text) ⇒ Object
- #clear ⇒ Object
-
#initialize(text = '') ⇒ Comment
constructor
A new instance of Comment.
-
#is_ie5_hack? ⇒ Boolean
looks for a \ at the end of the comment, indicating that it is a the start of an IE5 hack why anyone is still doing this, is beyond me! :-).
-
#is_special? ⇒ Boolean
special comments start with a ! and should not be deleted.
- #to_s(format = nil) ⇒ Object
Methods inherited from CssBase
Constructor Details
#initialize(text = '') ⇒ Comment
Returns a new instance of Comment.
6 7 8 9 10 |
# File 'lib/modules/css_comment.rb', line 6 def initialize(text='') @text = text @printable = true self end |
Instance Attribute Details
#printable ⇒ Object
Returns the value of attribute printable.
4 5 6 |
# File 'lib/modules/css_comment.rb', line 4 def printable @printable end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/modules/css_comment.rb', line 4 def text @text end |
Instance Method Details
#<<(text) ⇒ Object
12 13 14 |
# File 'lib/modules/css_comment.rb', line 12 def << (text) @text << text end |
#clear ⇒ Object
36 37 38 39 |
# File 'lib/modules/css_comment.rb', line 36 def clear @text = '' @printable = false end |
#is_ie5_hack? ⇒ Boolean
looks for a \ at the end of the comment, indicating that it is a the start of an IE5 hack why anyone is still doing this, is beyond me! :-)
32 33 34 |
# File 'lib/modules/css_comment.rb', line 32 def is_ie5_hack? text[-1,1] == '\\' end |
#is_special? ⇒ Boolean
special comments start with a ! and should not be deleted
25 26 27 |
# File 'lib/modules/css_comment.rb', line 25 def is_special? text[0,1] == '!' end |
#to_s(format = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/modules/css_comment.rb', line 16 def to_s(format=nil) if @printable "/*#{@text}*/" else '' end end |