Class: Axel::Uri

Inherits:
Typhoid::Uri
  • Object
show all
Defined in:
lib/axel/uri.rb

Instance Method Summary collapse

Instance Method Details

#app_nameObject



18
19
20
# File 'lib/axel/uri.rb', line 18

def app_name
  dashed_app_name.underscore.humanize.titleize
end

#configObject



3
4
5
6
7
# File 'lib/axel/uri.rb', line 3

def config
  (
    Axel._config.environment_uri_config || {}
  ).with_indifferent_access
end

#dashed_app_nameObject



22
23
24
# File 'lib/axel/uri.rb', line 22

def dashed_app_name
  base.host.to_s.gsub(/\..*$/, "")
end

#to(config_key, staging_number = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/axel/uri.rb', line 9

def to(config_key, staging_number = nil)
  new_base = apply_suffix dashed_app_name,
    staging_number,
    config_for(config_key)[:host]
  base.host = new_base
  base.scheme = config_for(config_key)[:scheme]
  self
end