class DaFunk::ScreenFlow
Attributes
screen_methods[RW]
setup[RW]
screens[R]
Public Class Methods
new()
click to toggle source
# File lib/da_funk/screen_flow.rb, line 16 def initialize @screens = [] self.class.screen_methods.each{|method| send(method) } end
screen(method, &block)
click to toggle source
# File lib/da_funk/screen_flow.rb, line 8 def self.screen(method, &block) self.screen_methods ||= [] self.screen_methods << method define_method method do @screens << CallbackFlow.new(self, @screens.last, &block) end end
Public Instance Methods
confirm(text)
click to toggle source
# File lib/da_funk/screen_flow.rb, line 33 def confirm(text) puts text.chomp getc(0) end
setup()
click to toggle source
# File lib/da_funk/screen_flow.rb, line 25 def setup end
start()
click to toggle source
# File lib/da_funk/screen_flow.rb, line 28 def start first = self.screens.first first.dispatch(true) if first end