Debian Codegraph @

plugin/mastodon/model/account_profile.rb

raw symbols SCIP
1 # coding: utf-8
2 require 'cgi'
3
4 module Plugin::Mastodon
5 class AccountProfile < Diva::Model
6 extend Memoist
7 include Diva::Model::MessageMixin
8
9 register :mastodon_account_profile, name: Plugin[:mastodon]._('Mastodonアカウントプロフィール'), timeline: true, myself: true
10
11 field.has :account, Account, required: true
12 alias :user :account
13
14 attr_reader :description
15 attr_reader :score
16
17 def initialize(hash)
18 super hash
19
20 @description, @score = Plugin::Mastodon::Parser.dictate_score(account.note, emojis: account.emojis)
21 end
22
23 def created
24 account.created_at
25 end
26
27 def title
28 account.display_name
29 end
30
31 def perma_link
32 account.url
33 end
34
35 def uri
36 account.url
37 end
38 end
39 end
40