lib/sysdig/alert.rb in sysdig-0.2.4 vs lib/sysdig/alert.rb in sysdig-0.3.0
- old
+ new
@@ -16,11 +16,11 @@
attribute :notify, parser: lambda { |v, _| (Array(v) || []).map { |x| x.to_s.upcase } }
attribute :segment_by, alias: "segmentBy"
attribute :segment_condition, alias: "segmentCondition"
attribute :severity, type: :integer
attribute :targets, type: :array
- attribute :timespan, parser: lambda { |v, _| i = v.to_i; i > 1_000_000 ? i / 1_000_000 : i }
- attribute :type, parser: lambda { |v, _| v.to_s.upcase }
+ attribute :timespan, parser: method(:microsecond_datetime)
+ attribute :type, parser: method(:upcase)
attribute :version, type: :integer
def destroy
requires :identity