Class: Aviary::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/aviary/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paginator) ⇒ Page

Returns a new instance of Page.



9
10
11
12
# File 'lib/aviary/page.rb', line 9

def initialize(paginator)
  @paginator   = paginator
  @image_hosts = ImageHost.all(@paginator.query_options.merge(:order => :id.desc))
end

Instance Attribute Details

#image_hostsObject (readonly)

Photos for the current page



4
5
6
# File 'lib/aviary/page.rb', line 4

def image_hosts
  @image_hosts
end

#paginatorObject (readonly)

Next page, previous page and current page



7
8
9
# File 'lib/aviary/page.rb', line 7

def paginator
  @paginator
end

Instance Method Details

#bindingObject



22
23
24
# File 'lib/aviary/page.rb', line 22

def binding
  super
end

#h(string) ⇒ Object

Escapes text by replacing < and > with their HTML character entity reference.

Returns escaped string.



18
19
20
# File 'lib/aviary/page.rb', line 18

def h(string)
  string.gsub('<', '&lt;').gsub('>', '&gt;')
end