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.



17
18
19
20
# File 'lib/telegram/bot/updates_controller/session.rb', line 17

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