Sha256: b6d5276fe242ef0a04ba5217b5477cb501af9a3a712f5d1898f15c9d7e94e3f1
Contents?: true
Size: 616 Bytes
Versions: 138
Compression:
Stored size: 616 Bytes
Contents
module CLI module UI module Prompt # A class that handles the various options of an InteractivePrompt and their callbacks class OptionsHandler def initialize @options = {} end def options @options.keys end def option(option, &handler) @options[option] = handler end def call(options) case options when Array options.map { |option| @options[option].call(options) } else @options[options].call(options) end end end end end end
Version data entries
138 entries across 138 versions & 3 rubygems