Class: Locomotive::Mounter::Reader::FileSystem::PagesReader
- Defined in:
- lib/locomotive/mounter/reader/file_system/pages_reader.rb
Instance Attribute Summary collapse
-
#pages ⇒ Object
Returns the value of attribute pages.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(runner) ⇒ PagesReader
constructor
A new instance of PagesReader.
-
#read ⇒ Hash
Build the tree of pages based on the filesystem structure.
Methods inherited from Base
Constructor Details
#initialize(runner) ⇒ PagesReader
Returns a new instance of PagesReader.
10 11 12 13 |
# File 'lib/locomotive/mounter/reader/file_system/pages_reader.rb', line 10 def initialize(runner) self.pages = {} super end |
Instance Attribute Details
#pages ⇒ Object
Returns the value of attribute pages.
8 9 10 |
# File 'lib/locomotive/mounter/reader/file_system/pages_reader.rb', line 8 def pages @pages end |
Instance Method Details
#read ⇒ Hash
Build the tree of pages based on the filesystem structure
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/locomotive/mounter/reader/file_system/pages_reader.rb', line 19 def read self.fetch index, not_found = self.pages['index'], self.pages['404'] # localize the fullpath for the 2 core pages: index and 404 [index, not_found].each { |p| p.localize_fullpath(self.locales) } self.build_relationships(index, self.pages_to_list) # Locomotive::Mounter.with_locale(:en) { self.to_s } # DEBUG # Locomotive::Mounter.with_locale(:fr) { self.to_s } # DEBUG self.pages end |