presumed_ham.rb
来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RB 代码 · 共 39 行
RB
39 行
module ContentState class PresumedHam < Base include Singleton def enter_hook(content) super content[:published] = true content[:status_confirmed] = false end def published?(content) true end def withdraw(content) mark_as_spam(content) end def confirm_classification(content) mark_as_ham(content) end def mark_as_ham(content) content.state = Factory.new(:ham) true end def to_s 'Ham?' end def send_notifications(content) content.interested_users.each do |user| content.send_notification_to_user(user) end end endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?