Class: Oryx::Preprocessor
- Inherits:
-
Object
- Object
- Oryx::Preprocessor
- Defined in:
- lib/oryx/preprocessor.rb
Instance Method Summary collapse
-
#initialize ⇒ Preprocessor
constructor
A new instance of Preprocessor.
- #parse(content) ⇒ Object
- #remove_comment(content) ⇒ Object
- #remove_outer_whitespace(content) ⇒ Object
Constructor Details
#initialize ⇒ Preprocessor
Returns a new instance of Preprocessor.
3 4 |
# File 'lib/oryx/preprocessor.rb', line 3 def initialize end |
Instance Method Details
#parse(content) ⇒ Object
6 7 8 9 |
# File 'lib/oryx/preprocessor.rb', line 6 def parse content content = remove_comment content remove_outer_whitespace content end |
#remove_comment(content) ⇒ Object
11 12 13 |
# File 'lib/oryx/preprocessor.rb', line 11 def remove_comment content content.gsub /\/\*.*?\*\//, '' end |
#remove_outer_whitespace(content) ⇒ Object
15 16 17 |
# File 'lib/oryx/preprocessor.rb', line 15 def remove_outer_whitespace content content.lstrip.rstrip end |