Class: Middleman::Pagination::Pageable

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman/pagination/pageable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Pageable

Returns a new instance of Pageable.



7
8
9
10
# File 'lib/middleman/pagination/pageable.rb', line 7

def initialize(name, &block)
  @name = name
  @set = block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/middleman/pagination/pageable.rb', line 5

def name
  @name
end

Instance Method Details

#new_resources(extension_context, resources) ⇒ Object



12
13
14
15
16
# File 'lib/middleman/pagination/pageable.rb', line 12

def new_resources(extension_context, resources)
  pagination_indexes(resources).map do |resource|
    new_pages_for_index(extension_context, resource, resources)
  end.compact
end