Class: Acmesmith::ChallengeResponders::Base
- Inherits:
-
Object
- Object
- Acmesmith::ChallengeResponders::Base
- Defined in:
- lib/acmesmith/challenge_responders/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#applicable?(domain) ⇒ true, false
True when a responder is able to challenge against given domain name.
-
#cap_respond_all? ⇒ true, false
True when implements #respond_all, #cleanup_all.
-
#cleanup(domain, challenge) ⇒ Object
If cap_respond_all? is true, you don’t need to implement this method.
-
#cleanup_all(*domain_and_challenges) ⇒ Object
Clean up responses for the given challenges (1 or more).
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#respond(domain, challenge) ⇒ Object
If cap_respond_all? is true, you don’t need to implement this method.
-
#respond_all(*domain_and_challenges) ⇒ Object
Respond to the given challenges (1 or more).
-
#support?(type) ⇒ true, false
True when given challenge type is supported.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
21 22 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 21 def initialize() end |
Instance Method Details
#applicable?(domain) ⇒ true, false
Returns true when a responder is able to challenge against given domain name.
12 13 14 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 12 def applicable?(domain) true end |
#cap_respond_all? ⇒ true, false
Returns true when implements #respond_all, #cleanup_all.
17 18 19 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 17 def cap_respond_all? false end |
#cleanup(domain, challenge) ⇒ Object
If cap_respond_all? is true, you don’t need to implement this method.
58 59 60 61 62 63 64 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 58 def cleanup(domain, challenge) if cap_respond_all? cleanup_all([domain, challenge]) else raise NotImplementedError end end |
#cleanup_all(*domain_and_challenges) ⇒ Object
Clean up responses for the given challenges (1 or more).
38 39 40 41 42 43 44 45 46 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 38 def cleanup_all(*domain_and_challenges) if cap_respond_all? raise NotImplementedError else domain_and_challenges.each do |dc| cleanup(*dc) end end end |
#respond(domain, challenge) ⇒ Object
If cap_respond_all? is true, you don’t need to implement this method.
49 50 51 52 53 54 55 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 49 def respond(domain, challenge) if cap_respond_all? respond_all([domain, challenge]) else raise NotImplementedError end end |
#respond_all(*domain_and_challenges) ⇒ Object
Respond to the given challenges (1 or more).
26 27 28 29 30 31 32 33 34 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 26 def respond_all(*domain_and_challenges) if cap_respond_all? raise NotImplementedError else domain_and_challenges.each do |dc| respond(*dc) end end end |
#support?(type) ⇒ true, false
Returns true when given challenge type is supported.
6 7 8 |
# File 'lib/acmesmith/challenge_responders/base.rb', line 6 def support?(type) raise NotImplementedError end |