Class: AhoyCaptain::PageDecorator

Inherits:
ApplicationDecorator show all
Defined in:
app/decorators/ahoy_captain/page_decorator.rb

Instance Attribute Summary

Attributes inherited from ApplicationDecorator

#object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationDecorator

#initialize, to_csv

Constructor Details

This class inherits a constructor from AhoyCaptain::ApplicationDecorator

Class Method Details

.csv_map(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'app/decorators/ahoy_captain/page_decorator.rb', line 3

def self.csv_map(params = {})
  {
    "URL" => :label,
    "Total" => :unit_amount
  }
end

Instance Method Details

#display_nameObject



14
15
16
17
# File 'app/decorators/ahoy_captain/page_decorator.rb', line 14

def display_name
  search = search_query(type => object.url)
  frame_link(object.url, search)
end

#labelObject



10
11
12
# File 'app/decorators/ahoy_captain/page_decorator.rb', line 10

def label
  object.url
end

#typeObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'app/decorators/ahoy_captain/page_decorator.rb', line 23

def type
  raise NotImplementedError
end

#unit_amountObject



19
20
21
# File 'app/decorators/ahoy_captain/page_decorator.rb', line 19

def unit_amount
  object.count
end