Class: Poisol::Domain

Inherits:
Object
  • Object
show all
Defined in:
lib/poisol/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain_config_file) ⇒ Domain

Returns a new instance of Domain.



5
6
7
8
9
10
11
12
13
14
# File 'lib/poisol/domain.rb', line 5

def initialize domain_config_file
  @file = domain_config_file
  path = ""
  if File.exists? @file
    base_hash = Parse.yaml_file @file
    sub_domain  = base_hash["sub_domain"]
    path = "/#{sub_domain}" if sub_domain.present?
  end
  @full_url = "#{ path.present? ? path: ''}"
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/poisol/domain.rb', line 3

def file
  @file
end

#full_urlObject (readonly)

Returns the value of attribute full_url.



3
4
5
# File 'lib/poisol/domain.rb', line 3

def full_url
  @full_url
end