Sha256: 924f2da31bdf6375a016dc575e0dda8cc7cb7f139d6e765aebfd9e19e69daf71

Contents?: true

Size: 462 Bytes

Versions: 3

Compression:

Stored size: 462 Bytes

Contents

module Loaf
  module CrumbFormatter

    def format_name(crumb, options={})
      if !crumb.name.blank?
        formatted = crumb.name
        formatted = crumb.name.capitalize if options[:capitalize]
        formatted = if options[:crumb_length]
          truncate(formatted, :length => options[:crumb_length])
        else
          formatted
        end
        formatted
      else
        '[name-error]'
      end
    end

  end # CrumbFormatter
end # Loaf

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loaf-0.3.0 lib/loaf/crumb_formatter.rb
loaf-0.2.1 lib/loaf/crumb_formatter.rb
loaf-0.2.0 lib/loaf/crumb_formatter.rb