class PCO::URL::ChurchCenter

Public Class Methods

new(app_name: "church-center", path: nil, query: nil, encrypt_query_params: false, domain: nil, subdomain: nil) click to toggle source
Calls superclass method PCO::URL::new
# File lib/pco/url/church_center.rb, line 4
def initialize(app_name: "church-center", path: nil, query: nil, encrypt_query_params: false, domain: nil, subdomain: nil)
  super(
    app_name: app_name,
    path: path,
    query: query,
    encrypt_query_params: encrypt_query_params,
    domain: domain
  )
  @subdomain = subdomain
end

Public Instance Methods

domain() click to toggle source
# File lib/pco/url/church_center.rb, line 15
def domain
  return @domain if @domain
  case env
  when "production", "staging"
    "churchcenter.com"
  when "development", "test"
    "churchcenter.test"
  end
end
hostname() click to toggle source
Calls superclass method PCO::URL#hostname
# File lib/pco/url/church_center.rb, line 25
def hostname
  super if env_overridden_hostname
  sub = "#{@subdomain}." if @subdomain
  if env == "staging"
    "#{sub}staging.#{domain}"
  else
    "#{sub}#{domain}"
  end
end