Class: AhoyCaptain::CityDecorator
Constant Summary
AhoyCaptain::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/city_decorator.rb', line 3
def self.csv_map(params = {})
{
"Country" => :country,
"City" => :city,
"Total" => :unit_amount
}
end
|
Instance Method Details
#country ⇒ Object
16
17
18
|
# File 'app/decorators/ahoy_captain/city_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/city_decorator.rb', line 11
def display_name
search = search_query(country_eq: object.country, city_eq: object.city)
frame_link("#{country_emoji(object.country)} #{object.city}", search)
end
|
#unit_amount ⇒ Object
20
21
22
|
# File 'app/decorators/ahoy_captain/city_decorator.rb', line 20
def unit_amount
object.count
end
|