Class: BunBunBundle::Config::DevServer
- Inherits:
-
Object
- Object
- BunBunBundle::Config::DevServer
- Defined in:
- lib/bun_bun_bundle/config.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ DevServer
constructor
A new instance of DevServer.
- #secure? ⇒ Boolean
- #ws_protocol ⇒ Object
- #ws_url ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ DevServer
Returns a new instance of DevServer.
39 40 41 42 43 |
# File 'lib/bun_bun_bundle/config.rb', line 39 def initialize(data = {}) @host = data.fetch('host', '127.0.0.1') @port = data.fetch('port', 3002) @secure = data.fetch('secure', false) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
37 38 39 |
# File 'lib/bun_bun_bundle/config.rb', line 37 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
37 38 39 |
# File 'lib/bun_bun_bundle/config.rb', line 37 def port @port end |
Instance Method Details
#secure? ⇒ Boolean
45 46 47 |
# File 'lib/bun_bun_bundle/config.rb', line 45 def secure? @secure end |
#ws_protocol ⇒ Object
49 50 51 |
# File 'lib/bun_bun_bundle/config.rb', line 49 def ws_protocol secure? ? 'wss' : 'ws' end |
#ws_url ⇒ Object
53 54 55 |
# File 'lib/bun_bun_bundle/config.rb', line 53 def ws_url "#{ws_protocol}://#{host}:#{port}" end |