Class: MetadataPresenter::PreviousPage

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/metadata_presenter/previous_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_pageObject

Returns the value of attribute current_page.



4
5
6
# File 'app/models/metadata_presenter/previous_page.rb', line 4

def current_page
  @current_page
end

#referrerObject

Returns the value of attribute referrer.



4
5
6
# File 'app/models/metadata_presenter/previous_page.rb', line 4

def referrer
  @referrer
end

#serviceObject

Returns the value of attribute service.



4
5
6
# File 'app/models/metadata_presenter/previous_page.rb', line 4

def service
  @service
end

#user_dataObject

Returns the value of attribute user_data.



4
5
6
# File 'app/models/metadata_presenter/previous_page.rb', line 4

def user_data
  @user_data
end

Instance Method Details

#pageObject



6
7
8
9
10
# File 'app/models/metadata_presenter/previous_page.rb', line 6

def page
  return if no_current_or_referrer_pages? || service.no_back_link?(current_page)

  TraversedPages.new(service, user_data, current_page).last
end