Class: SemiStatic::Snippet
- Includes:
- Convertable
- Defined in:
- lib/semi-static/snippet.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Snippet Name.
Attributes inherited from Base
#full_source_path, #site, #source_content, #source_ext, #source_metadata, #source_path
Instance Method Summary collapse
-
#initialize(site, path) ⇒ Snippet
constructor
Initialize a new Snippet.
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) ⇒ Snippet
Initialize a new Snippet.
site: The Site we belong to. path: Path to the source file.
14 15 16 17 |
# File 'lib/semi-static/snippet.rb', line 14 def initialize(site, path) super @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)
Snippet Name
7 8 9 |
# File 'lib/semi-static/snippet.rb', line 7 def name @name end |