Class: Audiothority::Violation
- Inherits:
-
Validation
- Object
- Validation
- Audiothority::Violation
- Defined in:
- lib/audiothority/validation.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #applicable? ⇒ Boolean
-
#initialize(field, reason, message, applicable = true) ⇒ Violation
constructor
A new instance of Violation.
Methods inherited from Validation
Constructor Details
#initialize(field, reason, message, applicable = true) ⇒ Violation
Returns a new instance of Violation.
21 22 23 24 25 26 27 |
# File 'lib/audiothority/validation.rb', line 21 def initialize(field, reason, , applicable=true) super(false) @field = field @reason = reason @message = @applicable = applicable end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
19 20 21 |
# File 'lib/audiothority/validation.rb', line 19 def field @field end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
19 20 21 |
# File 'lib/audiothority/validation.rb', line 19 def @message end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
19 20 21 |
# File 'lib/audiothority/validation.rb', line 19 def reason @reason end |
Instance Method Details
#applicable? ⇒ Boolean
29 30 31 |
# File 'lib/audiothority/validation.rb', line 29 def applicable? !!@applicable end |