Class: AhoyCaptain::CampaignDecorator
Instance Attribute Summary
#object
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, to_csv
Class Method Details
.csv_map(params = {}) ⇒ Object
4
5
6
7
8
9
|
# File 'app/decorators/ahoy_captain/campaign_decorator.rb', line 4
def self.csv_map(params = {})
{
params[:campaigns_type] => :label,
"Total" => :unit_amount
}
end
|
Instance Method Details
#display_name ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/decorators/ahoy_captain/campaign_decorator.rb', line 11
def display_name
if object.label == "Direct/None"
value = ""
else
value = object.label
end
search = search_query("#{params[:campaigns_type]}_eq" => value)
frame_link(object.label, search)
end
|
#unit_amount ⇒ Object
23
24
25
|
# File 'app/decorators/ahoy_captain/campaign_decorator.rb', line 23
def unit_amount
object.count
end
|