Class: TelegramWorkflow::Action

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/telegram_workflow/rspec.rb,
lib/telegram_workflow/action.rb

Instance Method Summary collapse

Constructor Details

#initialize(workflow, session, flash) ⇒ Action

Returns a new instance of Action.



5
6
7
8
9
# File 'lib/telegram_workflow/action.rb', line 5

def initialize(workflow, session, flash)
  @__workflow = workflow
  @__session = session
  @__flash = flash
end

Instance Method Details

#__reset_callbacksObject



23
24
25
# File 'lib/telegram_workflow/action.rb', line 23

def __reset_callbacks
  @on_redirect = @on_message = nil
end

#__run_on_messageObject



31
32
33
# File 'lib/telegram_workflow/action.rb', line 31

def __run_on_message
  @on_message.call if @on_message
end

#__run_on_redirectObject



27
28
29
# File 'lib/telegram_workflow/action.rb', line 27

def __run_on_redirect
  @on_redirect.call if @on_redirect
end

#on_message(&block) ⇒ Object



19
20
21
# File 'lib/telegram_workflow/action.rb', line 19

def on_message(&block)
  @on_message = block
end

#on_redirect(&block) ⇒ Object



15
16
17
# File 'lib/telegram_workflow/action.rb', line 15

def on_redirect(&block)
  @on_redirect = block
end

#sharedObject



11
12
13
# File 'lib/telegram_workflow/action.rb', line 11

def shared
  :__continue
end