Class: React::Rails::HotLoader::Server
- Inherits:
-
Object
- Object
- React::Rails::HotLoader::Server
- Defined in:
- lib/hot_loader/server.rb
Instance Attribute Summary collapse
-
#change_set_class ⇒ Object
readonly
Returns the value of attribute change_set_class.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(host: "0.0.0.0", port: 8082, change_set_class: React::Rails::HotLoader::AssetChangeSet) ⇒ Server
constructor
A new instance of Server.
-
#restart ⇒ Object
Restarts the server if it has stopped.
Constructor Details
#initialize(host: "0.0.0.0", port: 8082, change_set_class: React::Rails::HotLoader::AssetChangeSet) ⇒ Server
Returns a new instance of Server.
9 10 11 12 13 |
# File 'lib/hot_loader/server.rb', line 9 def initialize(host: "0.0.0.0", port: 8082, change_set_class: React::Rails::HotLoader::AssetChangeSet) @host = host @port = port @change_set_class = change_set_class end |
Instance Attribute Details
#change_set_class ⇒ Object (readonly)
Returns the value of attribute change_set_class.
7 8 9 |
# File 'lib/hot_loader/server.rb', line 7 def change_set_class @change_set_class end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/hot_loader/server.rb', line 7 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/hot_loader/server.rb', line 7 def port @port end |
Instance Method Details
#restart ⇒ Object
Restarts the server if it has stopped
16 17 18 19 20 21 |
# File 'lib/hot_loader/server.rb', line 16 def restart return if running? start rescue StandardError => err React::Rails::HotLoader.error(err) end |