class Refinery::Pages::Url

Attributes

page[R]

Public Class Methods

build(page) click to toggle source
# File lib/refinery/pages/url.rb, line 56
def self.build(page)
  klass = [ Localised, Marketable, Normal ].detect { |d| d.handle?(page) } || self
  klass.new(page).url
end
new(page) click to toggle source
# File lib/refinery/pages/url.rb, line 61
def initialize(page)
  @page = page
end

Public Instance Methods

url() click to toggle source
# File lib/refinery/pages/url.rb, line 65
def url
  raise NotImplementedError
end

Private Instance Methods

base_url_hash() click to toggle source
# File lib/refinery/pages/url.rb, line 80
def base_url_hash
  { :controller => '/refinery/pages', :action => 'show', :only_path => true }
end
with_locale_param(url_hash) click to toggle source
# File lib/refinery/pages/url.rb, line 73
def with_locale_param(url_hash)
  if (locale = Refinery::I18n.current_frontend_locale) != ::I18n.locale
    url_hash.update :locale => locale if locale
  end
  url_hash
end