Class: Vines::Config::HttpPort
Instance Attribute Summary
Attributes inherited from Port
Instance Method Summary collapse
- #bind(url = nil) ⇒ Object
-
#initialize(config, host = '0.0.0.0', port = 5280, &block) ⇒ HttpPort
constructor
A new instance of HttpPort.
- #max_resources_per_account(max = nil) ⇒ Object
- #root(dir = nil) ⇒ Object
- #start ⇒ Object
- #vroute(id = nil) ⇒ Object
Methods inherited from Port
Methods included from Log
Constructor Details
#initialize(config, host = '0.0.0.0', port = 5280, &block) ⇒ HttpPort
Returns a new instance of HttpPort.
77 78 79 80 81 82 |
# File 'lib/vines/config/port.rb', line 77 def initialize(config, host='0.0.0.0', port=5280, &block) @stream = Vines::Stream::Http super(config, host, port, &block) defaults = {:root => File.('web'), :bind => '/xmpp'} @settings = defaults.merge(@settings) end |
Instance Method Details
#bind(url = nil) ⇒ Object
100 101 102 103 104 105 106 |
# File 'lib/vines/config/port.rb', line 100 def bind(url=nil) if url @settings[:bind] = url else @settings[:bind] end end |
#max_resources_per_account(max = nil) ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/vines/config/port.rb', line 84 def max_resources_per_account(max=nil) if max @settings[:max_resources_per_account] = max else @settings[:max_resources_per_account] end end |
#root(dir = nil) ⇒ Object
92 93 94 95 96 97 98 |
# File 'lib/vines/config/port.rb', line 92 def root(dir=nil) if dir @settings[:root] = File.(dir) else @settings[:root] end end |
#start ⇒ Object
117 118 119 120 121 122 |
# File 'lib/vines/config/port.rb', line 117 def start super if config.cluster? && vroute.nil? log.warn("vroute sticky session cookie not set") end end |
#vroute(id = nil) ⇒ Object
108 109 110 111 112 113 114 115 |
# File 'lib/vines/config/port.rb', line 108 def vroute(id=nil) if id id = id.to_s.strip @settings[:vroute] = id.empty? ? nil : id else @settings[:vroute] end end |