Class: WatchList::Client
- Inherits:
-
Object
- Object
- WatchList::Client
- Defined in:
- lib/watch_list/client.rb
Constant Summary collapse
- MONITOR_ATTRS =
[ :URL, :Type, :SubType, :Port, :KeywordType, :KeywordValue, :HTTPUsername, :HTTPPassword, :AlertContacts, :Interval, ]
Instance Method Summary collapse
- #apply(file) ⇒ Object
- #export ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #status ⇒ Object
Constructor Details
Instance Method Details
#apply(file) ⇒ Object
38 39 40 |
# File 'lib/watch_list/client.rb', line 38 def apply(file) walk(file) end |
#export ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/watch_list/client.rb', line 21 def export exported = WatchList::Exporter.export(@uptimerobot, @options) if block_given? exported.each do |name, attrs| dsl = WatchList::DSL.convert({name => attrs}, @options).strip yield(name, dsl) unless dsl.empty? end else WatchList::DSL.convert(exported, @options) end end |
#status ⇒ Object
34 35 36 |
# File 'lib/watch_list/client.rb', line 34 def status WatchList::Exporter.export_status(@uptimerobot, @options) end |