Class: SemiStatic::Snippet

Inherits:
Base
  • Object
show all
Includes:
Convertable
Defined in:
lib/semi-static/snippet.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#full_source_path, #site, #source_content, #source_ext, #source_metadata, #source_path

Instance Method Summary collapse

Methods included from Convertable

#content, #layout, #layout_name, #load, #object_ref, #render, #snippet, #source_mtime, #underscore

Methods inherited from Base

#source_mtime

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

#nameObject (readonly)

Snippet Name



7
8
9
# File 'lib/semi-static/snippet.rb', line 7

def name
  @name
end