Module: TelegramWorkflow

Defined in:
lib/telegram_workflow.rb,
lib/telegram_workflow/config.rb,
lib/telegram_workflow/version.rb

Defined Under Namespace

Modules: Errors, Stores Classes: Action, Client, Configuration, InputFile, Params, Session, Updates, Workflow

Constant Summary collapse

VERSION =
"1.8.0"

Class Method Summary collapse

Class Method Details

.__after_configuration(&block) ⇒ Object



18
19
20
# File 'lib/telegram_workflow/config.rb', line 18

def __after_configuration(&block)
  @__after_configuration = block
end

.configObject



7
8
9
# File 'lib/telegram_workflow/config.rb', line 7

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



11
12
13
14
15
16
# File 'lib/telegram_workflow/config.rb', line 11

def configure
  yield(config)
  config.verify!

  @__after_configuration.call(config)
end

.process(params) ⇒ Object



8
9
10
# File 'lib/telegram_workflow.rb', line 8

def self.process(params)
  Workflow.new(params).process
end

.stop_updatesObject



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

def self.stop_updates
  @updates && @updates.stop = true
end

.updates(offset: nil, limit: nil, timeout: 60, allowed_updates: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/telegram_workflow.rb', line 12

def self.updates(offset: nil, limit: nil, timeout: 60, allowed_updates: nil)
  params = {}
  params[:offset] = offset if offset
  params[:limit] = limit if limit
  params[:timeout] = timeout if timeout
  params[:allowed_updates] = allowed_updates if allowed_updates

  (@updates = Updates.new(params)).enum
end