Class: Jekyll::StaticFileReader
- Inherits:
-
Object
- Object
- Jekyll::StaticFileReader
- Defined in:
- lib/jekyll/readers/static_file_reader.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
-
#unfiltered_content ⇒ Object
readonly
Returns the value of attribute unfiltered_content.
Instance Method Summary collapse
-
#initialize(site, dir) ⇒ StaticFileReader
constructor
A new instance of StaticFileReader.
-
#read(files) ⇒ Object
Read all the files in <source>/<dir>/ for Yaml header and create a new Page object for each file.
Constructor Details
#initialize(site, dir) ⇒ StaticFileReader
Returns a new instance of StaticFileReader.
4 5 6 7 8 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 4 def initialize(site, dir) @site = site @dir = dir @unfiltered_content = [] end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
3 4 5 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 3 def dir @dir end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
3 4 5 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 3 def site @site end |
#unfiltered_content ⇒ Object (readonly)
Returns the value of attribute unfiltered_content.
3 4 5 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 3 def unfiltered_content @unfiltered_content end |
Instance Method Details
#read(files) ⇒ Object
Read all the files in <source>/<dir>/ for Yaml header and create a new Page object for each file.
dir - The String relative path of the directory to read.
Returns an array of static files.
16 17 18 19 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 16 def read(files) files.map { |file| @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file) } @unfiltered_content end |