Class: UnderOs::Parser
- Inherits:
-
Object
- Object
- UnderOs::Parser
- Defined in:
- lib/under_os/parser.rb
Overview
Generic templates/stylesheets parsing engine
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(filename) ⇒ Object
Constructor Details
Class Method Details
.parse(*args) ⇒ Object
5 6 7 8 |
# File 'lib/under_os/parser.rb', line 5 def self.parse(*args) @inst ||= new @inst.parse *args end |
Instance Method Details
#parse(filename) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/under_os/parser.rb', line 15 def parse(filename) filepath = NSBundle.mainBundle.pathForResource(filename, ofType:nil) content = filepath ? UnderOs::File.read(filepath) : '' case filename.split('.').pop when 'css' then @css.parse(content) when 'html' then @html.parse(content) end end |