Class: TopicPoster

Inherits:
OpenStruct
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
app/models/topic_poster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'app/models/topic_poster.rb', line 6

def description
  @description
end

#extrasObject

Returns the value of attribute extras.



6
7
8
# File 'app/models/topic_poster.rb', line 6

def extras
  @extras
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'app/models/topic_poster.rb', line 6

def id
  @id
end

#primary_groupObject

Returns the value of attribute primary_group.



6
7
8
# File 'app/models/topic_poster.rb', line 6

def primary_group
  @primary_group
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'app/models/topic_poster.rb', line 6

def user
  @user
end

Instance Method Details

#attributesObject



8
9
10
11
12
13
14
15
16
# File 'app/models/topic_poster.rb', line 8

def attributes
  {
    "user" => user,
    "description" => description,
    "extras" => extras,
    "id" => id,
    "primary_group" => primary_group,
  }
end

#name_and_descriptionObject



18
19
20
# File 'app/models/topic_poster.rb', line 18

def name_and_description
  I18n.t("js.user.avatar.name_and_description", name: user.display_name, description: description)
end