Class: Hipbot::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hipbot/configuration.rb

Constant Summary collapse

OPTIONS =
[
  :adapter, :case_insensitive, :exception_handler, :helpers, :join, :join_on_invite,
  :logger, :password, :plugins, :preloader, :rooms, :status, :storage, :teams, :user
]

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/hipbot/configuration.rb', line 9

def initialize
  self.class.class_eval do
    attr_accessor *Hipbot.adapters.flat_map(&:options).compact
  end

  self.adapter        = Adapters::Hipchat
  self.case_insensitive  = true
  self.exception_handler = proc do |e|
    Hipbot.logger.error(e.message)
    e.backtrace.each { |line| Hipbot.logger.error(line) }
  end
  self.helpers       = Module.new
  self.join          = :all
  self.join_on_invite = true
  self.logger        = Logger.new($stdout)
  self.password      = ''
  self.plugins       = Hipbot.plugins
  self.preloader     = proc {}
  self.rooms         = {}
  self.status        = ''
  self.storage       = Storages::Hash
  self.teams         = {}
end

Instance Method Details

#userObject



33
34
35
# File 'lib/hipbot/configuration.rb', line 33

def user
  @user ||= User.new(name: 'robot')
end