Class: FaultInjection::FaultConditionLine
- Inherits:
-
FaultConditionBase
- Object
- FaultConditionBase
- FaultInjection::FaultConditionLine
- Defined in:
- lib/fault_injection/fault_condition.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
Attributes inherited from FaultConditionBase
#error_class, #limit_times, #message, #probability
Instance Method Summary collapse
-
#initialize(file, line, prob = 1) ⇒ FaultConditionLine
constructor
A new instance of FaultConditionLine.
Methods inherited from FaultConditionBase
Constructor Details
#initialize(file, line, prob = 1) ⇒ FaultConditionLine
Returns a new instance of FaultConditionLine.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fault_injection/fault_condition.rb', line 39 def initialize(file,line,prob=1) @file = file @line = line self.probability = prob if @line <= 0 raise ArgumentError,"line number must be greater than 0." end if prob < 0 or prob > 1 raise ArgumentError, "Probability must be between 0 and 1." end super() end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
36 37 38 |
# File 'lib/fault_injection/fault_condition.rb', line 36 def file @file end |
#line ⇒ Object
Returns the value of attribute line.
37 38 39 |
# File 'lib/fault_injection/fault_condition.rb', line 37 def line @line end |