Class: PageListFormatStrategies::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/page_list_format_strategies/base.rb

Overview

Base class that represents the interface all pages format strategy classes must implement.

Direct Known Subclasses

WithUniqueViewCount, WithViewCount

Instance Method Summary collapse

Constructor Details

#initialize(pages:) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/page_list_format_strategies/base.rb', line 7

def initialize(pages:)
  @pages = pages
end

Instance Method Details

#callObject

It is expected that all sub class strategies will override this method and provide it’s own formatting algorithm / behaviour. The result however is always an array of the new format the Pages have taken.



14
15
16
# File 'lib/page_list_format_strategies/base.rb', line 14

def call
  pages
end