Sha256: d65de867301fef007695040e08319e0fd4abeb16b03c160e4dda0d1a08edb5e1
Contents?: true
Size: 722 Bytes
Versions: 7
Compression:
Stored size: 722 Bytes
Contents
class Radiosonde::Wrapper::AlarmCollection include Radiosonde::Logger::Helper def initialize(cloud_watch, alarms, options = {}) @cloud_watch = cloud_watch @alarms = alarms @options = options end def each @alarms.each do |alarm| yield(Radiosonde::Wrapper::Alarm.new(@cloud_watch, alarm, @options)) end end def create(name, dsl) log(:info, 'Create Alarm', :cyan, name) opts = Radiosonde::Wrapper::Alarm.normalize_attrs(dsl) if @options[:dry_run] alarm = OpenStruct.new(opts.merge(:alarm_name => name)) else alarm = @alarms.create(name, opts) @cloud_watch.modify! end Radiosonde::Wrapper::Alarm.new(@cloud_watch, alarm, @options) end end
Version data entries
7 entries across 7 versions & 1 rubygems