Sha256: c58c918da20ef8489affb648a6f165e29ffecd3c55343bb3b4658e98408d0878

Contents?: true

Size: 265 Bytes

Versions: 2

Compression:

Stored size: 265 Bytes

Contents

require_relative "base"

module Administrate
  module Field
    class String < Field::Base
      def truncate
        data[0...truncation_length]
      end

      private

      def truncation_length
        options.fetch(:truncate, 50)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
administrate-0.0.11 lib/administrate/fields/string.rb
administrate-0.0.10 lib/administrate/fields/string.rb