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
- #private_storage(enabled) ⇒ Object
- #private_storage? ⇒ Boolean
- #root(dir = 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.
174 175 176 177 178 179 |
# File 'lib/vines/config.rb', line 174 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
205 206 207 208 209 210 211 |
# File 'lib/vines/config.rb', line 205 def bind(url=nil) if url @settings[:bind] = url else @settings[:bind] end end |
#max_resources_per_account(max = nil) ⇒ Object
181 182 183 184 185 186 187 |
# File 'lib/vines/config.rb', line 181 def max_resources_per_account(max=nil) if max @settings[:max_resources_per_account] = max else @settings[:max_resources_per_account] end end |
#private_storage(enabled) ⇒ Object
189 190 191 |
# File 'lib/vines/config.rb', line 189 def private_storage(enabled) @settings[:private_storage] = !!enabled end |
#private_storage? ⇒ Boolean
193 194 195 |
# File 'lib/vines/config.rb', line 193 def private_storage? @settings[:private_storage] end |
#root(dir = nil) ⇒ Object
197 198 199 200 201 202 203 |
# File 'lib/vines/config.rb', line 197 def root(dir=nil) if dir @settings[:root] = File.(dir) else @settings[:root] end end |