Class: ServerSettings::Host
- Inherits:
-
Object
- Object
- ServerSettings::Host
- Defined in:
- lib/server_settings/host.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host, port) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(host, port) ⇒ Host
Returns a new instance of Host.
5 6 7 8 |
# File 'lib/server_settings/host.rb', line 5 def initialize(host,port) @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/server_settings/host.rb', line 4 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'lib/server_settings/host.rb', line 4 def port @port end |
Class Method Details
.parse(host_line) ⇒ Object
10 11 12 13 |
# File 'lib/server_settings/host.rb', line 10 def self.parse(host_line) host, port = host_line.split(/:/) self.new(host,port) end |