Class: Bunto::LayoutReader
- Inherits:
-
Object
- Object
- Bunto::LayoutReader
- Defined in:
- lib/bunto/readers/layout_reader.rb
Instance Attribute Summary collapse
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site) ⇒ LayoutReader
constructor
A new instance of LayoutReader.
- #layout_directory ⇒ Object
- #read ⇒ Object
- #theme_layout_directory ⇒ Object
Constructor Details
#initialize(site) ⇒ LayoutReader
Returns a new instance of LayoutReader.
4 5 6 7 |
# File 'lib/bunto/readers/layout_reader.rb', line 4 def initialize(site) @site = site @layouts = {} end |
Instance Attribute Details
#site ⇒ Object (readonly)
Returns the value of attribute site.
3 4 5 |
# File 'lib/bunto/readers/layout_reader.rb', line 3 def site @site end |
Instance Method Details
#layout_directory ⇒ Object
23 24 25 |
# File 'lib/bunto/readers/layout_reader.rb', line 23 def layout_directory @layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source) end |
#read ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bunto/readers/layout_reader.rb', line 9 def read layout_entries.each do |layout_file| @layouts[layout_name(layout_file)] = \ Layout.new(site, layout_directory, layout_file) end theme_layout_entries.each do |layout_file| @layouts[layout_name(layout_file)] ||= \ Layout.new(site, theme_layout_directory, layout_file) end @layouts end |
#theme_layout_directory ⇒ Object
27 28 29 |
# File 'lib/bunto/readers/layout_reader.rb', line 27 def theme_layout_directory @theme_layout_directory ||= site.theme.layouts_path if site.theme end |