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
Create a new StaticFile object for every entry in a given list of basenames.
Constructor Details
#initialize(site, dir) ⇒ StaticFileReader
Returns a new instance of StaticFileReader.
7 8 9 10 11 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 7 def initialize(site, dir) @site = site @dir = dir @unfiltered_content = [] end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
5 6 7 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 5 def dir @dir end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
5 6 7 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 5 def site @site end |
#unfiltered_content ⇒ Object (readonly)
Returns the value of attribute unfiltered_content.
5 6 7 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 5 def unfiltered_content @unfiltered_content end |
Instance Method Details
#read(files) ⇒ Object
Create a new StaticFile object for every entry in a given list of basenames.
files - an array of file basenames.
Returns an array of static files.
18 19 20 21 22 23 |
# File 'lib/jekyll/readers/static_file_reader.rb', line 18 def read(files) files.each do |file| @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file) end @unfiltered_content end |