Class: MockServerThin::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



17
18
19
20
21
# File 'lib/mock_server_thin.rb', line 17

def initialize
  @timeout = 5
  @port = 4000
  @host = "0.0.0.0"
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



15
16
17
# File 'lib/mock_server_thin.rb', line 15

def host
  @host
end

#portObject

Returns the value of attribute port.



15
16
17
# File 'lib/mock_server_thin.rb', line 15

def port
  @port
end

#timeoutObject

Returns the value of attribute timeout.



15
16
17
# File 'lib/mock_server_thin.rb', line 15

def timeout
  @timeout
end

Instance Method Details

#to_hashObject



23
24
25
# File 'lib/mock_server_thin.rb', line 23

def to_hash
  Hash[instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)] }]
end