Class: Rakyll::Compiler::Match
- Inherits:
-
Object
- Object
- Rakyll::Compiler::Match
- Includes:
- Apply, SetFilename
- Defined in:
- lib/rakyll/compiler/match.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(source_filename, opts) ⇒ Match
constructor
A new instance of Match.
- #save ⇒ Object
Methods included from SetFilename
Methods included from Apply
Constructor Details
#initialize(source_filename, opts) ⇒ Match
Returns a new instance of Match.
8 9 10 11 12 13 14 |
# File 'lib/rakyll/compiler/match.rb', line 8 def initialize(source_filename, opts) @source_filename = source_filename , markdown_string = YAML::FrontMatter.extract(File.read(@source_filename)) () set_body_from_markdown(markdown_string, opts) set_filename(source_filename, '.html') end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/rakyll/compiler/match.rb', line 6 def body @body end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/rakyll/compiler/match.rb', line 6 def url @url end |
Instance Method Details
#save ⇒ Object
16 17 18 |
# File 'lib/rakyll/compiler/match.rb', line 16 def save File.write(@filename, @body) end |