Class: Violation
- Inherits:
-
Object
- Object
- Violation
- Defined in:
- lib/violation.rb
Constant Summary collapse
- WARNING =
'warning'
- FATAL_VIOLATION =
'fatal violation'
- FAILING_VIOLATION =
'failing violation'
Instance Attribute Summary collapse
-
#logical_resource_ids ⇒ Object
readonly
Returns the value of attribute logical_resource_ids.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#violating_code ⇒ Object
readonly
Returns the value of attribute violating_code.
Instance Method Summary collapse
-
#initialize(type:, message:, logical_resource_ids: nil, violating_code: nil) ⇒ Violation
constructor
A new instance of Violation.
- #to_s ⇒ Object
Constructor Details
#initialize(type:, message:, logical_resource_ids: nil, violating_code: nil) ⇒ Violation
Returns a new instance of Violation.
9 10 11 12 13 14 15 16 17 |
# File 'lib/violation.rb', line 9 def initialize(type:, message:, logical_resource_ids: nil, violating_code: nil) @type = type @message = @logical_resource_ids = logical_resource_ids @violating_code = violating_code end |
Instance Attribute Details
#logical_resource_ids ⇒ Object (readonly)
Returns the value of attribute logical_resource_ids.
7 8 9 |
# File 'lib/violation.rb', line 7 def logical_resource_ids @logical_resource_ids end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/violation.rb', line 7 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/violation.rb', line 7 def type @type end |
#violating_code ⇒ Object (readonly)
Returns the value of attribute violating_code.
7 8 9 |
# File 'lib/violation.rb', line 7 def violating_code @violating_code end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/violation.rb', line 19 def to_s puts "#{@type} #{@message} #{@logical_resource_ids} #{@violating_code}" end |