Module: KaminariApiMetaData

Defined in:
lib/kaminari_api_meta_data.rb,
lib/kaminari_api_meta_data/version.rb

Constant Summary collapse

VERSION =
File.read(version_file).split("\n").first

Instance Method Summary collapse

Instance Method Details

#meta_data(collection, extra_meta = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/kaminari_api_meta_data.rb', line 6

def (collection, extra_meta = {})
  {
    current_page: collection.current_page,
    next_page: collection.next_page,
    per_page: collection.limit_value,
    prev_page: collection.prev_page,
    total_pages: collection.total_pages,
    total_count: collection.total_count
  }.merge(extra_meta)
end