Class: Tend::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/tend/models/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_pageObject

Returns the value of attribute current_page.



3
4
5
# File 'lib/tend/models/collection.rb', line 3

def current_page
  @current_page
end

#limitObject

Returns the value of attribute limit.



3
4
5
# File 'lib/tend/models/collection.rb', line 3

def limit
  @limit
end

#total_countObject

Returns the value of attribute total_count.



3
4
5
# File 'lib/tend/models/collection.rb', line 3

def total_count
  @total_count
end

#total_pagesObject

Returns the value of attribute total_pages.



3
4
5
# File 'lib/tend/models/collection.rb', line 3

def total_pages
  @total_pages
end

Instance Method Details

#init(paginator = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/tend/models/collection.rb', line 5

def init paginator = {}
  return unless paginator
  paginator.each do |k,v|
    next unless respond_to? "#{k}="
    send "#{k}=", v
  end
end