Class: AhoyCaptain::DeviceDecorator
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/device_decorator.rb', line 3
def self.csv_map(params = {})
{
"#{params[:devices_type]}" => :label,
"Total" => :unit_amount
}
end
|
Instance Method Details
#display_name ⇒ Object
10
11
12
13
|
# File 'app/decorators/ahoy_captain/device_decorator.rb', line 10
def display_name
search = search_query("#{params[:devices_type]}_eq" => label)
frame_link(label, search)
end
|
#label ⇒ Object
15
16
17
|
# File 'app/decorators/ahoy_captain/device_decorator.rb', line 15
def label
object.label
end
|
#total_count ⇒ Object
23
24
25
|
# File 'app/decorators/ahoy_captain/device_decorator.rb', line 23
def total_count
object.total_count
end
|
#unit_amount ⇒ Object
19
20
21
|
# File 'app/decorators/ahoy_captain/device_decorator.rb', line 19
def unit_amount
object.count
end
|