Module: SmartExcerpt::ClassMethods

Defined in:
lib/smart_excerpt.rb

Instance Method Summary collapse

Instance Method Details

#smart_excerpt(excerpt_field, base_field, words = 25) ⇒ Object



68
69
70
71
72
# File 'lib/smart_excerpt.rb', line 68

def smart_excerpt(excerpt_field, base_field, words = 25)
  define_method("get_#{excerpt_field}".to_sym) do |c_words = words|
    smart_truncate(self, base_field, excerpt_field, c_words)
  end
end