Class: ServerSettings::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/server_settings/host.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#hostObject

Returns the value of attribute host.



4
5
6
# File 'lib/server_settings/host.rb', line 4

def host
  @host
end

#portObject

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