Class: Rakyll::Compiler::Create
- Inherits:
-
Object
- Object
- Rakyll::Compiler::Create
- Includes:
- Apply, SetFilename
- Defined in:
- lib/rakyll/compiler/create.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(source_filename, opts) ⇒ Create
constructor
A new instance of Create.
- #load_all(pattern, opts = {}) ⇒ Object
- #save ⇒ Object
Methods included from SetFilename
Methods included from Apply
Constructor Details
#initialize(source_filename, opts) ⇒ Create
Returns a new instance of Create.
8 9 10 11 |
# File 'lib/rakyll/compiler/create.rb', line 8 def initialize(source_filename, opts) @source_filename = source_filename set_filename(source_filename) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/rakyll/compiler/create.rb', line 6 def url @url end |
Instance Method Details
#load_all(pattern, opts = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/rakyll/compiler/create.rb', line 13 def load_all(pattern, opts = {}) Dir.glob(pattern).map do |filename| Match.new filename, opts end end |
#save ⇒ Object
19 20 21 |
# File 'lib/rakyll/compiler/create.rb', line 19 def save File.write(@filename, @body) end |