Class: Eclix::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/eclix/publication_creator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, path) ⇒ Url

Returns a new instance of Url.



91
92
93
94
95
# File 'lib/eclix/publication_creator.rb', line 91

def initialize(server, path)
  @server=server
  @path=path
  @base=base_url(server)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



90
91
92
# File 'lib/eclix/publication_creator.rb', line 90

def base
  @base
end

#pathObject (readonly)

Returns the value of attribute path.



90
91
92
# File 'lib/eclix/publication_creator.rb', line 90

def path
  @path
end

Instance Method Details

#absoluteObject



97
98
99
# File 'lib/eclix/publication_creator.rb', line 97

def absolute
  "#{base}/#{path}"
end

#base_url(server) ⇒ Object



101
102
103
# File 'lib/eclix/publication_creator.rb', line 101

def base_url(server)
  "http://#{server.host}:#{server.port}"
end