Class: Yoda::Server::Providers::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/server/providers/base.rb

Overview

This class is abstract.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notifier:, session:) ⇒ Base

Returns a new instance of Base.

Parameters:



27
28
29
30
# File 'lib/yoda/server/providers/base.rb', line 27

def initialize(notifier:, session:)
  @notifier = notifier
  @session = session
end

Instance Attribute Details

#notifierNotifier (readonly)

Returns:



20
21
22
# File 'lib/yoda/server/providers/base.rb', line 20

def notifier
  @notifier
end

#sessionSession (readonly)

Returns:



23
24
25
# File 'lib/yoda/server/providers/base.rb', line 23

def session
  @session
end

Class Method Details

.provide?(method) ⇒ Boolean

Parameters:

  • method (Symbol)

Returns:

  • (Boolean)


14
15
16
# File 'lib/yoda/server/providers/base.rb', line 14

def provide?(method)
  provider_method == method
end

.provider_methodSymbol

This method is abstract.

Returns:

  • (Symbol)


9
10
11
# File 'lib/yoda/server/providers/base.rb', line 9

def provider_method
  fail NotImplementedError
end

Instance Method Details

#provide(params) ⇒ Object

This method is abstract.

Parameters:

  • params (Hash)


34
35
36
# File 'lib/yoda/server/providers/base.rb', line 34

def provide(params)
  fail NotImplementedError
end

#timeoutInteger?

Returns Seconds to timeout the task. if nil, the task does not timeout.

Returns:

  • (Integer, nil)

    Seconds to timeout the task. if nil, the task does not timeout.



39
40
41
# File 'lib/yoda/server/providers/base.rb', line 39

def timeout
  nil
end