1class ModerationDelay
 
2  include ActiveModel::Model
 
3
 
4  attr_accessor :subject, :body
 
5
 
6  validates :subject, presence: true, length: { maximum: 100 }
 
7  validates :body, presence: true, length: { maximum: 2000 }
 
8
  • Complexity 1 » saikuro
 9  def attributes
 
10    { "subject" => subject, "body" => body }
 
11  end
 
  • ManualDispatch - manually dispatches method call » reek
  • Complexity 3 » saikuro
13  def attributes=(hash)
 
14    hash = hash.stringify_keys
 
 
16    hash.each do |key, value|
 
17      if respond_to?("#{key}=")
 
18        public_send("#{key}=", value)
 
19      end
 
20    end
 
21  end
 
22end