Class: Lev::NullStatus

Inherits:
Object show all
Defined in:
lib/lev/null_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil) ⇒ NullStatus

Returns a new instance of NullStatus.



4
5
6
7
# File 'lib/lev/null_status.rb', line 4

def initialize(id=nil)
  @id = id || "null-status:#{SecureRandom.uuid}"
  @kill_requested = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, **kwargs, &block) ⇒ Object



17
18
19
# File 'lib/lev/null_status.rb', line 17

def method_missing(*args, **kwargs, &block)
  nil
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/lev/null_status.rb', line 2

def id
  @id
end

Instance Method Details

#add_errorObject



30
# File 'lib/lev/null_status.rb', line 30

def add_error(*); end

#failed!Object



35
# File 'lib/lev/null_status.rb', line 35

def failed!; end

#kill_requested?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/lev/null_status.rb', line 13

def kill_requested?
  @kill_requested
end

#killed!Object



36
# File 'lib/lev/null_status.rb', line 36

def killed!; end

#queued!Object



32
# File 'lib/lev/null_status.rb', line 32

def queued!; end

#request_kill!Object



9
10
11
# File 'lib/lev/null_status.rb', line 9

def request_kill!
  @kill_requested = true
end

#saveObject



29
# File 'lib/lev/null_status.rb', line 29

def save(*); end

#set_job_argsObject



26
# File 'lib/lev/null_status.rb', line 26

def set_job_args(*); end

#set_job_nameObject

Provide null object pattern methods for status setter methods called from within routines; routines should not be using other query methods to check their own status (they should know it), with the exception of ‘kill_requested?`



25
# File 'lib/lev/null_status.rb', line 25

def set_job_name(*); end

#set_progressObject



28
# File 'lib/lev/null_status.rb', line 28

def set_progress(*); end

#set_provider_job_idObject



27
# File 'lib/lev/null_status.rb', line 27

def set_provider_job_id(*); end

#started!Object



33
# File 'lib/lev/null_status.rb', line 33

def started!; end

#succeeded!Object



34
# File 'lib/lev/null_status.rb', line 34

def succeeded!; end