Class: Kompress::HTML
- Inherits:
-
Object
- Object
- Kompress::HTML
- Defined in:
- lib/kompress/kompress.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
Instance Method Summary collapse
-
#initialize(html) ⇒ HTML
constructor
A new instance of HTML.
Constructor Details
#initialize(html) ⇒ HTML
Returns a new instance of HTML.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/kompress/kompress.rb', line 30 def initialize(html) @html = html # take out spaces between the beginning or any number # of spaces until a tag @html.gsub!(/(?:^|\s+?)(<.*?>)/, '\1') # take out spaces between a tag and the end. @html.gsub!(/(<.*?>)(?:\s+)$/,'\1') @html end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
28 29 30 |
# File 'lib/kompress/kompress.rb', line 28 def html @html end |