Class: Bridgetown::FrontMatter::Loaders::Base
- Inherits:
-
Object
- Object
- Bridgetown::FrontMatter::Loaders::Base
- Defined in:
- bridgetown-core/lib/bridgetown-core/front_matter/loaders/base.rb
Overview
An abstract base class for processing front matter
Instance Method Summary collapse
-
#initialize(origin_or_layout) ⇒ Base
constructor
A new instance of Base.
-
#read(file_contents, file_path:) ⇒ Result?
Reads the contents of a file, returning a possible Result.
Constructor Details
#initialize(origin_or_layout) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'bridgetown-core/lib/bridgetown-core/front_matter/loaders/base.rb', line 9 def initialize(origin_or_layout) @origin_or_layout = origin_or_layout end |
Instance Method Details
#read(file_contents, file_path:) ⇒ Result?
Reads the contents of a file, returning a possible Result
18 19 20 |
# File 'bridgetown-core/lib/bridgetown-core/front_matter/loaders/base.rb', line 18 def read(file_contents, file_path:) # rubocop:disable Lint/UnusedMethodArgument raise "Implement #read in a subclass of Bridgetown::FrontMatter::Loaders::Base" end |