Module: Maveric::Views
- Defined in:
- lib/maveric.rb
Overview
Holds views related methods and helpers.
Instance Method Summary collapse
- #_(content) ⇒ Object
- #erubis_file(filename, binding) ⇒ Object
- #path_to(controller, args = {}) ⇒ Object
- #raw_file(filename) ⇒ Object
- #sprintf_file(filename, *params) ⇒ Object
Instance Method Details
#_(content) ⇒ Object
364 |
# File 'lib/maveric.rb', line 364 def _ content; content; end |
#erubis_file(filename, binding) ⇒ Object
374 375 376 377 |
# File 'lib/maveric.rb', line 374 def erubis_file filename, binding require 'erubis' ::Erubis::Eruby.new(raw_file(filename)).result(binding) end |
#path_to(controller, args = {}) ⇒ Object
379 380 381 |
# File 'lib/maveric.rb', line 379 def path_to controller, args={} @env[:maveric].path_to controller, args end |
#raw_file(filename) ⇒ Object
366 367 368 |
# File 'lib/maveric.rb', line 366 def raw_file filename File.read(filename) end |
#sprintf_file(filename, *params) ⇒ Object
370 371 372 |
# File 'lib/maveric.rb', line 370 def sprintf_file filename, *params raw_file(filename) % [*params] end |