Class: StatModule::Process
Constant Summary
Constants inherited from JSONable
JSONable::FORMATTING_BALL, JSONable::FORMATTING_CHECKMARK, JSONable::FORMATTING_STAR, JSONable::FORMATTING_WARNING
Instance Method Summary collapse
-
#description ⇒ Object
Get description.
-
#description=(description) ⇒ Object
Set description.
-
#email ⇒ Object
Get email.
-
#email=(email) ⇒ Object
Set email.
-
#initialize(name, hash = nil) ⇒ Process
constructor
Initialize new Process object.
-
#maintainer ⇒ Object
Get maintainer.
-
#maintainer=(maintainer) ⇒ Object
Set maintainer.
-
#name ⇒ Object
Get name of the process.
-
#name=(name) ⇒ Object
Set name of the process.
-
#print(formatted = nil) ⇒ Object
Get formatted information about process.
-
#repeatability ⇒ Object
Get repeatability.
-
#repeatability=(repeatability) ⇒ Object
Set repeatability.
-
#version ⇒ Object
Get version of the process.
-
#version=(version) ⇒ Object
Set version.
-
#website ⇒ Object
Get website.
-
#website=(website) ⇒ Object
Set website.
Methods inherited from JSONable
Constructor Details
#initialize(name, hash = nil) ⇒ Process
Initialize new Process object
Params:
name
-
String, name of the process, required
hash
-
Hash, can be null
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
#description ⇒ Object
Get description
67 68 69 |
# File 'lib/process.rb', line 67 def description @description end |
#description=(description) ⇒ Object
Set description
Params:
description
-
String
60 61 62 63 |
# File 'lib/process.rb', line 60 def description=(description) raise TypeException unless description.is_a?(String) @description = description end |
#email ⇒ Object
Get email
99 100 101 |
# File 'lib/process.rb', line 99 def email @email end |
#email=(email) ⇒ Object
Set email
Params:
email
-
String
92 93 94 95 |
# File 'lib/process.rb', line 92 def email=(email) raise TypeException unless email.is_a?(String) @email = email end |
#maintainer ⇒ Object
Get maintainer
83 84 85 |
# File 'lib/process.rb', line 83 def maintainer @maintainer end |
#maintainer=(maintainer) ⇒ Object
Set maintainer
Params:
maintainer
-
String
76 77 78 79 |
# File 'lib/process.rb', line 76 def maintainer=(maintainer) raise TypeException unless maintainer.is_a?(String) @maintainer = maintainer end |
#name ⇒ Object
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
28 29 30 31 |
# File 'lib/process.rb', line 28 def name=(name) raise TypeException unless name.is_a?(String) @name = name end |
#print(formatted = nil) ⇒ Object
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 |
#repeatability ⇒ Object
Get repeatability
131 132 133 |
# File 'lib/process.rb', line 131 def repeatability @repeatability end |
#repeatability=(repeatability) ⇒ Object
Set repeatability
Params:
repeatability
-
String
124 125 126 127 |
# File 'lib/process.rb', line 124 def repeatability=(repeatability) raise TypeException unless Repeatability.all.include?(repeatability) @repeatability = repeatability end |
#version ⇒ Object
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
44 45 46 47 |
# File 'lib/process.rb', line 44 def version=(version) raise TypeException unless version.is_a?(String) @version = version end |
#website ⇒ Object
Get website
115 116 117 |
# File 'lib/process.rb', line 115 def website @website end |
#website=(website) ⇒ Object
Set website
Params:
website
-
String
108 109 110 111 |
# File 'lib/process.rb', line 108 def website=(website) raise TypeException unless website.is_a?(String) @website = website end |