class BBS::Flow

A line-mode script for a caller: a list of steps that BBS::FlowRunner runs in order on the session. Each DSL method below appends one step (a Flow::Steps object); nothing is written to the caller while the flow is defined.

Steps share a context Hash that holds :session_id and the answers of ask. A step that reads a line ends the flow when the caller hangs up. Most boards use a Flow as glue only: a call step that runs the board’s own screen, then another for the goodbye.

FLOW = BBS::Flow.define do
  screen :welcome
  ask :name, prompt: 'Your name', transform: :upcase, validate: :non_empty
  say 'Nice to meet you.'
  menu 'Choose:', loop: true do
    option('Who am I') { text { |ctx| ctx[:name] } }
    option('Leave')    { exit_menu }
  end
end