Class: Spacelift::Policy::Violation
- Inherits:
-
Object
- Object
- Spacelift::Policy::Violation
- Defined in:
- lib/spacelift/policy/violation.rb
Overview
Violation encapsulates a resource’s violation of a single Rule.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(address:, rule:) ⇒ Violation
constructor
A new instance of Violation.
- #to_s ⇒ Object
Constructor Details
#initialize(address:, rule:) ⇒ Violation
Returns a new instance of Violation.
9 10 11 12 |
# File 'lib/spacelift/policy/violation.rb', line 9 def initialize(address:, rule:) @address = address @rule = rule end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
7 8 9 |
# File 'lib/spacelift/policy/violation.rb', line 7 def address @address end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
7 8 9 |
# File 'lib/spacelift/policy/violation.rb', line 7 def rule @rule end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/spacelift/policy/violation.rb', line 14 def to_s [address.red.bold, 'failed rule', rule.cyan.bold].join(' ') end |