Module: Rakismet::Model::InstanceMethods

Defined in:
lib/rakismet/model.rb

Instance Method Summary collapse

Instance Method Details

#ham!Object



51
52
53
54
# File 'lib/rakismet/model.rb', line 51

def ham!
  Rakismet.akismet_call('submit-ham', akismet_data)
  @_spam = false
end

#spam!Object



46
47
48
49
# File 'lib/rakismet/model.rb', line 46

def spam!
  Rakismet.akismet_call('submit-spam', akismet_data)
  @_spam = true
end

#spam?Boolean

Returns:

  • (Boolean)


36
37
38
39
40
41
42
43
44
# File 'lib/rakismet/model.rb', line 36

def spam?
  if instance_variable_defined? :@_spam
    @_spam
  else
    data = akismet_data(true) # Only spam? check should include http_headers
    self.akismet_response = Rakismet.akismet_call('comment-check', data)
    @_spam = self.akismet_response == 'true'
  end
end