Module: Telegram::Bot::UpdatesController::Session::ClassMethods

Defined in:
lib/telegram/bot/updates_controller/session.rb

Instance Method Summary collapse

Instance Method Details

#build_session(key, store = session_store) ⇒ Object

Builds session with given key and optional store (default to session_store). This way it’s easier to define multiple custom sessions, ex. one for group chat and one for user.



15
16
17
18
# File 'lib/telegram/bot/updates_controller/session.rb', line 15

def build_session(key, store = session_store)
  raise 'session_store is not configured' unless store
  key ? SessionHash.new(store, key) : NullSessionHash.new
end