Class: Telegram::Config

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/telegram/config.rb

Overview

Telegram client config

Available options:

* daemon: path to telegram-cli binary
* key: path to telegram-cli public key
* sock: path to Unix domain socket that telegram-cli will listen to
* size: connection pool size

Constant Summary collapse

DEFAULT_OPTIONS =
{
  daemon: 'bin/telegram',
  key: 'tg-server.pub',
  sock: 'tg.sock',
  size: 5
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



27
28
29
# File 'lib/telegram/config.rb', line 27

def initialize(options = {})
  @options = OpenStruct.new(DEFAULT_OPTIONS.merge(options))
end