Class: BunBunBundle::Config::DevServer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostObject (readonly)

Returns the value of attribute host.



37
38
39
# File 'lib/bun_bun_bundle/config.rb', line 37

def host
  @host
end

#portObject (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

Returns:

  • (Boolean)


45
46
47
# File 'lib/bun_bun_bundle/config.rb', line 45

def secure?
  @secure
end

#ws_protocolObject



49
50
51
# File 'lib/bun_bun_bundle/config.rb', line 49

def ws_protocol
  secure? ? 'wss' : 'ws'
end

#ws_urlObject



53
54
55
# File 'lib/bun_bun_bundle/config.rb', line 53

def ws_url
  "#{ws_protocol}://#{host}:#{port}"
end