Class: Goldencobra::Url

Inherits:
Object
  • Object
show all
Defined in:
app/services/goldencobra/url.rb

Class Method Summary collapse

Class Method Details

.hostObject



15
16
17
# File 'app/services/goldencobra/url.rb', line 15

def host
  Goldencobra::Setting.for_key("goldencobra.url").gsub(/(http|https):\/\//, "")
end

.protocolObject



11
12
13
# File 'app/services/goldencobra/url.rb', line 11

def protocol
  use_ssl? ? "https" : "http"
end

.to_sObject



3
4
5
# File 'app/services/goldencobra/url.rb', line 3

def to_s
  @url ||= build_url
end

.use_ssl?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/services/goldencobra/url.rb', line 7

def use_ssl?
  Goldencobra::Setting.for_key("goldencobra.use_ssl") == "true"
end