class RPicSim::Flaws::Flaw
Represents a flaw in RPicSim
, usually dues to bugs in the MPLAB X classes we are using. Stores the name of the flaw and knowledge about what versions of MPLAB X it affects and how.
Public Class Methods
Creates a new flaw with the specified name. @param name [Symbol] The name of this flaw. @api private
# File lib/rpicsim/flaws.rb, line 16 def initialize(name) @versions = {} end
Public Instance Methods
Records the effect this flaw has on a given version of MPLAB X. @api private
# File lib/rpicsim/flaws.rb, line 37 def affects_version(version, effect) @versions[version] = effect end
Returns the effect of this flaw on the specified version of MPLAB X. This might just be true/false to indicate if the flaw is present or it might be a more complicated thing if there is more than one effect the the flaw can have.
@param version [String] A version of MPLAB X, e.g. +'1.95'+. @return effect
# File lib/rpicsim/flaws.rb, line 27 def effect(version) if @versions.key? version @versions[version] else @probable_affect_for_other_versions end end
Records the effect that this flaw probably has in other versions of MPLAB X that have not been tested. This allows us to record our guesses about how the next version of MPLAB X will behave. @api private
# File lib/rpicsim/flaws.rb, line 45 def probably_affects_other_versions(effect) @probable_affect_for_other_versions = effect end