Class: Hipbot::Configuration
- Inherits:
-
Object
- Object
- Hipbot::Configuration
- 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
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #user ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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.) 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
#user ⇒ Object
33 34 35 |
# File 'lib/hipbot/configuration.rb', line 33 def user @user ||= User.new(name: 'robot') end |