Sha256: 32c16892f6fd9ec31fd4b92410ba1badbe1b6ec142e77225266a20740d8eb1ec
Contents?: true
Size: 739 Bytes
Versions: 4
Compression:
Stored size: 739 Bytes
Contents
require 'annotator/initial_description/base' Dir[File.dirname(__FILE__) + '/initial_description/*.rb'].each {|file| require file } module Annotator module InitialDescription DEFAULT_DESCRIPTION = "TODO: document me" NO_DESCRIPTION_COLUMNS = %w{email name title body} # Get initial description for given model & column def self.for(model, column) # Check if any module provides such description Base.providers.each do |klass| provider = klass.new model, column return provider.text if provider.check end # Some columns are just too obvious return "" if NO_DESCRIPTION_COLUMNS.include? column # Let user do the work return DEFAULT_DESCRIPTION end end end
Version data entries
4 entries across 4 versions & 1 rubygems