Class: StatModule::Process

Inherits:
JSONable show all
Defined in:
lib/process.rb

Constant Summary

Constants inherited from JSONable

JSONable::FORMATTING_BALL, JSONable::FORMATTING_CHECKMARK, JSONable::FORMATTING_STAR, JSONable::FORMATTING_WARNING

Instance Method Summary collapse

Methods inherited from JSONable

from_json!, #to_json

Constructor Details

#initialize(name, hash = nil) ⇒ Process

Initialize new Process object

Params:

name

String, name of the process, required

hash

Hash, can be null

Raises:



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

def initialize(name, hash = nil)
  if hash.is_a? Hash
    super(hash)
    return
  end

  raise TypeException unless name.is_a?(String)
  @name = name
end

Instance Method Details

#descriptionObject

Get description



67
68
69
# File 'lib/process.rb', line 67

def description
  @description
end

#description=(description) ⇒ Object

Set description

Params:

description

String

Raises:



60
61
62
63
# File 'lib/process.rb', line 60

def description=(description)
  raise TypeException unless description.is_a?(String)
  @description = description
end

#emailObject

Get email



99
100
101
# File 'lib/process.rb', line 99

def email
  @email
end

#email=(email) ⇒ Object

Set email

Params:

email

String

Raises:



92
93
94
95
# File 'lib/process.rb', line 92

def email=(email)
  raise TypeException unless email.is_a?(String)
  @email = email
end

#maintainerObject

Get maintainer



83
84
85
# File 'lib/process.rb', line 83

def maintainer
  @maintainer
end

#maintainer=(maintainer) ⇒ Object

Set maintainer

Params:

maintainer

String

Raises:



76
77
78
79
# File 'lib/process.rb', line 76

def maintainer=(maintainer)
  raise TypeException unless maintainer.is_a?(String)
  @maintainer = maintainer
end

#nameObject

Get name of the process



35
36
37
# File 'lib/process.rb', line 35

def name
  @name
end

#name=(name) ⇒ Object

Set name of the process

Params:

name

String, name of the process, required

Raises:



28
29
30
31
# File 'lib/process.rb', line 28

def name=(name)
  raise TypeException unless name.is_a?(String)
  @name = name
end

Get formatted information about process

Params:

formatted

indicate weather print boring or pretty colorful process



141
142
143
144
145
146
147
148
149
150
# File 'lib/process.rb', line 141

def print(formatted = nil)
  result = name
  unless version.nil?
    result += ", version #{version}"
  end
  if formatted
    result = "#{FORMATTING_STAR.colorize(:yellow)} #{result}"
  end
  result
end

#repeatabilityObject

Get repeatability



131
132
133
# File 'lib/process.rb', line 131

def repeatability
  @repeatability
end

#repeatability=(repeatability) ⇒ Object

Set repeatability

Params:

repeatability

String

Raises:



124
125
126
127
# File 'lib/process.rb', line 124

def repeatability=(repeatability)
  raise TypeException unless Repeatability.all.include?(repeatability)
  @repeatability = repeatability
end

#versionObject

Get version of the process



51
52
53
# File 'lib/process.rb', line 51

def version
  @version
end

#version=(version) ⇒ Object

Set version

Params:

version

String

Raises:



44
45
46
47
# File 'lib/process.rb', line 44

def version=(version)
  raise TypeException unless version.is_a?(String)
  @version = version
end

#websiteObject

Get website



115
116
117
# File 'lib/process.rb', line 115

def website
  @website
end

#website=(website) ⇒ Object

Set website

Params:

website

String

Raises:



108
109
110
111
# File 'lib/process.rb', line 108

def website=(website)
  raise TypeException unless website.is_a?(String)
  @website = website
end