Sha256: c67f88e3c2267b0599d04690408ccface485d78877a4b97b779e8356899cd84e

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

# encoding: utf-8

module Loaf
  # A mixin for formatting crumb name
  module CrumbFormatter
    # @param [String] name
    #   the name to format
    #
    # @api public
    def format_name(name, options = {})
      return if name.nil?

      formatted = name.to_s.dup
      formatted = formatted.capitalize if options[:capitalize]
      if options[:crumb_length]
        formatted = truncate(formatted, length: options[:crumb_length])
      end
      formatted
    end
  end # CrumbFormatter
end # Loaf

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loaf-0.4.0 lib/loaf/crumb_formatter.rb