Class: Origen::Bugs::Bug
Instance Attribute Summary collapse
-
#affected_versions ⇒ Object
readonly
Returns the value of attribute affected_versions.
-
#name ⇒ Object
(also: #id)
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #fixed_on_version ⇒ Object
-
#initialize(name, options = {}) ⇒ Bug
constructor
A new instance of Bug.
- #present_on_version?(version, _options = {}) ⇒ Boolean
Constructor Details
#initialize(name, options = {}) ⇒ Bug
Returns a new instance of Bug.
9 10 11 12 13 |
# File 'lib/origen/bugs/bug.rb', line 9 def initialize(name, = {}) @name = name @affected_versions = [[:affected_version] || [:affected_versions]].flatten.compact @fixed_on_version = [:fixed_on_version] end |
Instance Attribute Details
#affected_versions ⇒ Object (readonly)
Returns the value of attribute affected_versions.
4 5 6 |
# File 'lib/origen/bugs/bug.rb', line 4 def affected_versions @affected_versions end |
#name ⇒ Object (readonly) Also known as: id
Returns the value of attribute name.
6 7 8 |
# File 'lib/origen/bugs/bug.rb', line 6 def name @name end |
Instance Method Details
#fixed_on_version ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/origen/bugs/bug.rb', line 27 def fixed_on_version @fixed_on_version || begin unless affected_versions.empty? affected_versions.max + 1 end end end |
#present_on_version?(version, _options = {}) ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/origen/bugs/bug.rb', line 15 def present_on_version?(version, = {}) if affected_versions.empty? if fixed_on_version version < fixed_on_version else true end else affected_versions.include?(version) end end |