Class: DNS::Monitor::Check
- Inherits:
-
Object
- Object
- DNS::Monitor::Check
- Defined in:
- lib/dns/monitor/check.rb
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#initialize(domain, status, diff = {}) ⇒ Check
constructor
A “Check” is an encapsulated domain query result.
- #ok? ⇒ Boolean
- #status ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(domain, status, diff = {}) ⇒ Check
A “Check” is an encapsulated domain query result.
5 6 7 8 9 |
# File 'lib/dns/monitor/check.rb', line 5 def initialize(domain, status, diff={}) @diff = diff @domain = domain @status = status end |
Instance Method Details
#changed? ⇒ Boolean
11 12 13 |
# File 'lib/dns/monitor/check.rb', line 11 def changed? @status == :changed end |
#ok? ⇒ Boolean
15 16 17 |
# File 'lib/dns/monitor/check.rb', line 15 def ok? @status == :ok end |
#status ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dns/monitor/check.rb', line 19 def status case @status when :ok { domain: @domain, ok: true } when :changed { domain: @domain, changes: @diff } else :error end end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/dns/monitor/check.rb', line 30 def to_s status.inspect end |