Class Nanoc::CodeSnippet
In: lib/nanoc/base/source_data/code_snippet.rb
Parent: Object

Nanoc::CodeSnippet represent a piece of custom code of a nanoc site.

Methods

checksum   inspect   load   new   reference  

Attributes

data  [R]  A string containing the actual code in this code snippet.

@return [String]

filename  [R]  The filename corresponding to this code snippet.

@return [String]

Public Class methods

Creates a new code snippet.

@param [String] data The raw source code which will be executed before

  compilation

@param [String] filename The filename corresponding to this code snippet

@param [Time, Hash] params Extra parameters. Ignored by nanoc; it is

  only included for backwards compatibility.

Public Instance methods

@return [String] The checksum for this object. If its contents change,

  the checksum will change as well.

Loads the code by executing it.

@return [void]

Returns an object that can be used for uniquely identifying objects.

@return [Object] An unique reference to this object

[Validate]