Class: Labkit::RateLimit::Config::Schema::Violation
- Inherits:
-
Data
- Object
- Data
- Labkit::RateLimit::Config::Schema::Violation
- Defined in:
- lib/labkit/rate_limit/config/schema.rb
Overview
for_key marks a violation on a map key; its path is the entry's path.
Instance Attribute Summary collapse
-
#for_key ⇒ Object
readonly
Returns the value of attribute for_key.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#rule_id ⇒ Object
readonly
Returns the value of attribute rule_id.
Instance Method Summary collapse
-
#initialize(path:, rule_id:, message:, for_key: false) ⇒ Violation
constructor
A new instance of Violation.
- #to_s ⇒ Object
Constructor Details
#initialize(path:, rule_id:, message:, for_key: false) ⇒ Violation
Returns a new instance of Violation.
30 31 32 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 30 def initialize(path:, rule_id:, message:, for_key: false) super end |
Instance Attribute Details
#for_key ⇒ Object (readonly)
Returns the value of attribute for_key
29 30 31 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 29 def for_key @for_key end |
#message ⇒ Object (readonly)
Returns the value of attribute message
29 30 31 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 29 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
29 30 31 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 29 def path @path end |
#rule_id ⇒ Object (readonly)
Returns the value of attribute rule_id
29 30 31 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 29 def rule_id @rule_id end |
Instance Method Details
#to_s ⇒ Object
34 35 36 |
# File 'lib/labkit/rate_limit/config/schema.rb', line 34 def to_s path.empty? ? "#{} (#{rule_id})" : "#{path}: #{} (#{rule_id})" end |