Class: Rails::Buddy::Config

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

Constant Summary collapse

DEFAULT_BUGGER_SIZE =
200
DEFAULT_PATH_PREFIX =
'/buddy'

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  opt = defaults.merge options

  @prefix       = opt[:prefix]
  @buffer_size  = opt[:buffer_size]
end

Instance Attribute Details

#buffer_sizeObject

Returns the value of attribute buffer_size.



9
10
11
# File 'lib/rails/buddy/config.rb', line 9

def buffer_size
  @buffer_size
end

#prefixObject

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

Returns:

  • (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