Module: Nanoc::StringExtensions

Included in:
String
Defined in:
lib/nanoc/base/core_ext/string.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) checksum

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Calculates the checksum for this string. Any change to this string will result in a different checksum.

Returns:

  • (String)

    The checksum for this string



17
18
19
# File 'lib/nanoc/base/core_ext/string.rb', line 17

def checksum
  Nanoc::Checksummer.calc(self)
end

- (String) cleaned_identifier

Transforms string into an actual identifier

Returns:

  • (String)

    The identifier generated from the receiver



7
8
9
# File 'lib/nanoc/base/core_ext/string.rb', line 7

def cleaned_identifier
  "/#{self}/".gsub(/^\/+|\/+$/, '/')
end