Class: Eclix::Url
- Inherits:
-
Object
- Object
- Eclix::Url
- Defined in:
- lib/eclix/publication_creator.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #absolute ⇒ Object
- #base_url(server) ⇒ Object
-
#initialize(server, path) ⇒ Url
constructor
A new instance of Url.
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
#base ⇒ Object (readonly)
Returns the value of attribute base.
90 91 92 |
# File 'lib/eclix/publication_creator.rb', line 90 def base @base end |
#path ⇒ Object (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
#absolute ⇒ Object
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 |