Class: Quintype::Liquid::Templates
- Inherits:
-
Object
- Object
- Quintype::Liquid::Templates
- Defined in:
- lib/quintype/liquid/templates.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
-
#initialize ⇒ Templates
constructor
A new instance of Templates.
- #templates ⇒ Object
Constructor Details
#initialize ⇒ Templates
Returns a new instance of Templates.
5 6 7 8 |
# File 'lib/quintype/liquid/templates.rb', line 5 def initialize @root = Rails.root.join("app", "views").to_s @paths = Dir.glob("#{@root}/**/*.liquid").sort end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
3 4 5 |
# File 'lib/quintype/liquid/templates.rb', line 3 def paths @paths end |
Instance Method Details
#templates ⇒ Object
10 11 12 13 14 15 |
# File 'lib/quintype/liquid/templates.rb', line 10 def templates paths.reduce({}) do |acc, path| acc[clean_path(path)] = IO.read path acc end end |