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



88
89
90
91
92
# File 'lib/smart_excerpt.rb', line 88

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