Class: MockServerThin::Config
- Inherits:
-
Object
- Object
- MockServerThin::Config
- Defined in:
- lib/mock_server_thin.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Config
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
#host ⇒ Object
Returns the value of attribute host.
15 16 17 |
# File 'lib/mock_server_thin.rb', line 15 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
15 16 17 |
# File 'lib/mock_server_thin.rb', line 15 def port @port end |
#timeout ⇒ Object
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_hash ⇒ Object
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 |