Class: FeedsuckerPost

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/feedsucker_post.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/feedsucker_post.rb', line 6

def method_missing(method, *args, &block)
  if (method.to_s =~ /^(.+)_without_tags$/)
    if str = self.send($1)
      str.gsub!(/<.*?>/,'')
      begin
        strip_tags(str)
      rescue
        ActionController::Base.helpers.strip_tags(str)
      end
    end
  else
    super
  end
end