2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
class TopicPoster < OpenStruct
|
|
|
|
include ActiveModel::Serialization
|
|
|
|
|
2017-02-18 06:54:43 +08:00
|
|
|
attr_accessor :user, :description, :extras, :id, :primary_group
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
def attributes
|
2013-03-23 21:39:01 +08:00
|
|
|
{
|
|
|
|
'user' => user,
|
|
|
|
'description' => description,
|
|
|
|
'extras' => extras,
|
2017-02-18 06:54:43 +08:00
|
|
|
'id' => id,
|
|
|
|
'primary_group' => primary_group
|
2013-03-23 21:39:01 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
# TODO: Remove when old list is removed
|
|
|
|
def [](attr)
|
2019-05-07 09:57:55 +08:00
|
|
|
public_send(attr)
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|