Class: Matchd::Rule::Fail
- Inherits:
-
Matchd::Rule
- Object
- Matchd::Rule
- Matchd::Rule::Fail
- Defined in:
- lib/matchd/rule/fail.rb
Constant Summary
Constants inherited from Matchd::Rule
NotImplementedError, REGEXP_MATCHER, REGEXP_OPTIONS
Instance Attribute Summary
Attributes inherited from Matchd::Rule
Instance Method Summary collapse
-
#initialize(options) ⇒ Fail
constructor
A new instance of Fail.
- #rcode ⇒ Object
- #visit!(_server, _name, _resource_class, transaction) ⇒ Object
Methods inherited from Matchd::Rule
#call, #match_name, #match_resource_classes, #matches?, parse_match, parse_resource_class
Constructor Details
#initialize(options) ⇒ Fail
Returns a new instance of Fail.
2 3 4 5 |
# File 'lib/matchd/rule/fail.rb', line 2 def initialize() super @fail = .fetch("fail") end |
Instance Method Details
#rcode ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/matchd/rule/fail.rb', line 11 def rcode @rcode ||= case @fail when Symbol, String then Resolv::DNS::RCode.const_get(@fail) else @fail end end |
#visit!(_server, _name, _resource_class, transaction) ⇒ Object
7 8 9 |
# File 'lib/matchd/rule/fail.rb', line 7 def visit!(_server, _name, _resource_class, transaction) transaction.fail!(rcode) end |