Class: SemiStatic::Layout
- Includes:
- Convertable
- Defined in:
- lib/semi-static/layout.rb
Overview
Layout embeds the formatted output of a Convertable within a large document.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The Layout’s name.
Attributes inherited from Base
#full_source_path, #site, #source_content, #source_ext, #source_metadata, #source_path
Instance Method Summary collapse
-
#initialize(site, path) ⇒ Layout
constructor
Initialize a new Layout.
Methods included from Convertable
#content, #layout, #layout_name, #load, #object_ref, #render, #snippet, #source_mtime, #underscore
Methods inherited from Base
Constructor Details
#initialize(site, path) ⇒ Layout
Initialize a new Layout
site: The Site we belong to. path: The path to the source file.
16 17 18 19 20 21 |
# File 'lib/semi-static/layout.rb', line 16 def initialize(site, path) super = [ :layout ] @name = File.basename(source_path, source_ext) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SemiStatic::Base
Instance Attribute Details
#name ⇒ Object (readonly)
The Layout’s name
9 10 11 |
# File 'lib/semi-static/layout.rb', line 9 def name @name end |