Class: DomainSanity::Reason
- Inherits:
-
Struct
- Object
- Struct
- DomainSanity::Reason
- Defined in:
- lib/domain_sanity/reason.rb
Overview
A single, structured reason a subject failed validation.
code is a stable Symbol meant for programmatic branching (it does not
change when the wording of a message is tweaked). message is the
human-readable explanation. label is the specific offending DNS label
when one applies (e.g. a label that is too long or malformed), and nil
otherwise.
Reason#to_s returns the message, so an array of reasons still interpolates
and joins into readable text, while callers that need to react in code can
switch on code.
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#label ⇒ Object
Returns the value of attribute label.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
15 16 17 |
# File 'lib/domain_sanity/reason.rb', line 15 def code @code end |
#label ⇒ Object
Returns the value of attribute label
15 16 17 |
# File 'lib/domain_sanity/reason.rb', line 15 def label @label end |
#message ⇒ Object
Returns the value of attribute message
15 16 17 |
# File 'lib/domain_sanity/reason.rb', line 15 def @message end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/domain_sanity/reason.rb', line 16 def to_s end |