Class: Alula::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/meta.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta) ⇒ Meta

Returns a new instance of Meta.



5
6
7
8
9
10
11
12
13
14
# File 'lib/alula/meta.rb', line 5

def initialize(meta)
  return unless meta['page']

  @page = Alula::Pagination.new(meta['page'])

  # TODO: TJ Deprecate, the meta can hold a lot more than the page
  @total = @page.total
  @number = @page.number
  @size = @page.size
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



3
4
5
# File 'lib/alula/meta.rb', line 3

def number
  @number
end

#pageObject (readonly)

Returns the value of attribute page.



3
4
5
# File 'lib/alula/meta.rb', line 3

def page
  @page
end

#sizeObject (readonly)

Returns the value of attribute size.



3
4
5
# File 'lib/alula/meta.rb', line 3

def size
  @size
end

#totalObject (readonly)

Returns the value of attribute total.



3
4
5
# File 'lib/alula/meta.rb', line 3

def total
  @total
end