Class: WatchList::DSL::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/watch_list/dsl/converter.rb

Constant Summary collapse

TYPE_ATTRS =
[
  :SubType,
  :Port,
  :KeywordType,
  :KeywordValue,
  :HTTPUsername,
  :HTTPPassword,
]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exported, options = {}) ⇒ Converter

of class methods



17
18
19
20
# File 'lib/watch_list/dsl/converter.rb', line 17

def initialize(exported, options = {})
  @exported = exported
  @options = options
end

Class Method Details

.convert(exported, opts = {}) ⇒ Object



12
13
14
# File 'lib/watch_list/dsl/converter.rb', line 12

def convert(exported, opts = {})
  self.new(exported, opts).convert
end

Instance Method Details

#convertObject



22
23
24
25
26
27
# File 'lib/watch_list/dsl/converter.rb', line 22

def convert
  [
    output_monitors(@exported[:monitors]),
    output_alert_contacts(@exported[:alert_contacts]),
  ].join("\n\n")
end