Class: AhoyCaptain::SourceDecorator
Instance Attribute Summary
#object
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, to_csv
Class Method Details
.csv_map(params = {}) ⇒ Object
3
4
5
6
7
8
|
# File 'app/decorators/ahoy_captain/source_decorator.rb', line 3
def self.csv_map(params = {})
{
"Domain" => :referring_domain,
"Total" => :unit_amount
}
end
|
Instance Method Details
#display_name ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/decorators/ahoy_captain/source_decorator.rb', line 10
def display_name
display = %Q(
<div class='flex justify-start space-x-8 col-span-1 items-center'>
<img class='transparent w-5 h-5'
src='https://www.google.com/s2/favicons?domain=#{object.referring_domain}&sz=32'
/>
<span>#{object.referring_domain}</span>
</div>
).html_safe
path = search_query(ref_domain_eq: object.referring_domain)
frame_link(display, path)
end
|
#unit_amount ⇒ Object
23
24
25
|
# File 'app/decorators/ahoy_captain/source_decorator.rb', line 23
def unit_amount
object.count
end
|