Class: Decidim::Core::StatisticType
Instance Method Summary
collapse
allowed_to?, authorized?, determine_subject_name, local_admin_context, local_context, permission_chain
Instance Method Details
#description ⇒ Object
37
38
39
40
41
42
43
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 37
def description
organization.available_locales.to_h do |locale|
I18n.with_locale(locale) do
[locale, I18n.t(stat[:tooltip_key], scope: "decidim.statistics")]
end
end
end
|
#key ⇒ Object
21
22
23
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 21
def key
stat[:name]
end
|
#name ⇒ Object
29
30
31
32
33
34
35
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 29
def name
organization.available_locales.to_h do |locale|
I18n.with_locale(locale) do
[locale, I18n.t(key, scope: "decidim.statistics")]
end
end
end
|
#organization ⇒ Object
13
14
15
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 13
def organization
object[0]
end
|
#stat ⇒ Object
17
18
19
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 17
def stat
object[1]
end
|
#value ⇒ Object
25
26
27
|
# File 'decidim-core/lib/decidim/api/types/statistic_type.rb', line 25
def value
stat[:data][0]
end
|