Class: StatModule::Stat
Instance Attribute Summary collapse
-
#statVersion ⇒ Object
readonly
Returns the value of attribute statVersion.
Instance Method Summary collapse
- #findings ⇒ Object
- #findings=(findings) ⇒ Object
-
#initialize(process) ⇒ Stat
constructor
A new instance of Stat.
- #process ⇒ Object
- #process=(process) ⇒ Object
Methods inherited from JSONable
Constructor Details
#initialize(process) ⇒ Stat
Returns a new instance of Stat.
16 17 18 19 20 21 |
# File 'lib/stat.rb', line 16 def initialize(process) raise TypeException unless process.is_a?(StatModule::Process) @statVersion = '1.0.0' @process = process @findings = [] end |
Instance Attribute Details
#statVersion ⇒ Object (readonly)
Returns the value of attribute statVersion.
14 15 16 |
# File 'lib/stat.rb', line 14 def statVersion @statVersion end |
Instance Method Details
#findings ⇒ Object
32 33 34 |
# File 'lib/stat.rb', line 32 def findings @findings end |
#findings=(findings) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/stat.rb', line 23 def findings=(findings) raise TypeException unless findings.is_a?(Array) findings.each { |item| raise TypeException unless item.is_a?(StatModule::Finding) raise DuplicateElementException if @findings.include?(item) @findings.push(item) } end |
#process ⇒ Object
41 42 43 |
# File 'lib/stat.rb', line 41 def process @process end |
#process=(process) ⇒ Object
36 37 38 39 |
# File 'lib/stat.rb', line 36 def process=(process) raise TypeException unless process.is_a?(StatModule::Process) @process = process end |