Class: Tuxedo::CaneViolation::ThresholdViolation
- Inherits:
-
Tuxedo::CaneViolation
- Object
- Tuxedo::CaneViolation
- Tuxedo::CaneViolation::ThresholdViolation
- Defined in:
- lib/tuxedo/cane_violation/threshold_violation.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Tuxedo::CaneViolation
#violation_type, #violation_type_snake_cased
Instance Attribute Details
#limit ⇒ Object
Returns the value of attribute limit.
4 5 6 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 4 def limit @limit end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 4 def name @name end |
#operator ⇒ Object
Returns the value of attribute operator.
4 5 6 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 4 def operator @operator end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 4 def value @value end |
Class Method Details
.from_cane(cane_violation) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 6 def self.from_cane(cane_violation) violation = new violation.name = cane_violation.name violation.operator = cane_violation.operator violation.value = cane_violation.value violation.limit = cane_violation.limit violation end |
Instance Method Details
#description ⇒ Object
17 18 19 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 17 def description "Quality threshold crossed" end |
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tuxedo/cane_violation/threshold_violation.rb', line 21 def to_hash { :violation_type => violation_type, :name => name, :operator => operator, :value => value, :limit => limit, :description => description, } end |