Class: Pageflow::InternalLinks::GridHelper::Grid

Inherits:
Struct
  • Object
show all
Defined in:
app/helpers/pageflow/internal_links/grid_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#layoutObject

Returns the value of attribute layout

Returns:

  • (Object)

    the current value of layout



10
11
12
# File 'app/helpers/pageflow/internal_links/grid_helper.rb', line 10

def layout
  @layout
end

Returns the value of attribute page_links

Returns:

  • (Object)

    the current value of page_links



10
11
12
# File 'app/helpers/pageflow/internal_links/grid_helper.rb', line 10

def page_links
  @page_links
end

#templateObject

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template



10
11
12
# File 'app/helpers/pageflow/internal_links/grid_helper.rb', line 10

def template
  @template
end

Instance Method Details

#item(position) ⇒ Object



15
16
17
18
19
20
21
22
# File 'app/helpers/pageflow/internal_links/grid_helper.rb', line 15

def item(position)
  page_link = page_links_by_position[position.to_i] || PageLink.null

  template.(:li,
                       page_link.target_page ? thumbnail_link(page_link, hero?(position)) : '',
                       :data => {:reference_key => position},
                       :class => page_link.target_page ? 'title_hover' : 'title_hover empty')
end

#renderObject



11
12
13
# File 'app/helpers/pageflow/internal_links/grid_helper.rb', line 11

def render
  template.render('pageflow/internal_links/grid/grid', grid: self)
end