Module: Metro::Views::Parsers
Instance Method Summary collapse
-
#parsers ⇒ Array<Parsers>
An array of all the registered view parsers.
- #parsers_with_no_view_fallback ⇒ Object
-
#register(parser) ⇒ Object
Register a view parser.
Instance Method Details
#parsers ⇒ Array<Parsers>
Returns an array of all the registered view parsers. The last parser is the NoView parser.
27 28 29 |
# File 'lib/metro/views/parsers.rb', line 27 def parsers @parsers ||= [] end |
#parsers_with_no_view_fallback ⇒ Object
31 32 33 |
# File 'lib/metro/views/parsers.rb', line 31 def parsers_with_no_view_fallback parsers + [ NoView ] end |
#register(parser) ⇒ Object
Register a view parser.
A parser is any class or instance that responds to #exists?(view_path), #parse(view_path) and #format.
19 20 21 |
# File 'lib/metro/views/parsers.rb', line 19 def register(parser) parsers.push parser end |