Class: AhoyCaptain::RegionDecorator
Constant Summary
CountryDecorator::EMOJI_MAP
Instance Attribute Summary
#object
Class Method Summary
collapse
Instance Method Summary
collapse
#label
#initialize, to_csv
Class Method Details
.csv_map(params = {}) ⇒ Object
3
4
5
6
7
8
9
|
# File 'app/decorators/ahoy_captain/region_decorator.rb', line 3
def self.csv_map(params = {})
{
"Country" => :country,
"Region" => :region,
"Total" => :unit_amount
}
end
|
Instance Method Details
#country ⇒ Object
16
17
18
|
# File 'app/decorators/ahoy_captain/region_decorator.rb', line 16
def country
"#{country_emoji(object.country)} #{object.country}"
end
|
#display_name ⇒ Object
11
12
13
14
|
# File 'app/decorators/ahoy_captain/region_decorator.rb', line 11
def display_name
search = search_query(region_eq: object.region, country_eq: object.country)
frame_link("#{country_emoji(object.country)} #{object.region}", search)
end
|
#region ⇒ Object
20
21
22
|
# File 'app/decorators/ahoy_captain/region_decorator.rb', line 20
def region
object.region
end
|
#unit_amount ⇒ Object
24
25
26
|
# File 'app/decorators/ahoy_captain/region_decorator.rb', line 24
def unit_amount
object.count
end
|