Class: Rails::Buddy::Config
- Inherits:
-
Object
- Object
- Rails::Buddy::Config
- Defined in:
- lib/rails/buddy/config.rb
Constant Summary collapse
- DEFAULT_BUGGER_SIZE =
200- DEFAULT_PATH_PREFIX =
'/buddy'
Instance Attribute Summary collapse
-
#buffer_size ⇒ Object
Returns the value of attribute buffer_size.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
Instance Method Summary collapse
- #ignore_request?(env) ⇒ Boolean
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 |
# File 'lib/rails/buddy/config.rb', line 11 def initialize( = {}) opt = defaults.merge @prefix = opt[:prefix] @buffer_size = opt[:buffer_size] end |
Instance Attribute Details
#buffer_size ⇒ Object
Returns the value of attribute buffer_size.
9 10 11 |
# File 'lib/rails/buddy/config.rb', line 9 def buffer_size @buffer_size end |
#prefix ⇒ Object
Returns the value of attribute prefix.
9 10 11 |
# File 'lib/rails/buddy/config.rb', line 9 def prefix @prefix end |
Instance Method Details
#ignore_request?(env) ⇒ Boolean
18 19 20 |
# File 'lib/rails/buddy/config.rb', line 18 def ignore_request?(env) [prefix, '/assets'].any? { |s| env['PATH_INFO'].start_with? s } || env['HTTP_UPGRADE'] == 'websocket' end |