Sha256: e60acff5bfb39da393b89689720438579b8402916315e76573678a9792a7b157
Contents?: true
Size: 647 Bytes
Versions: 13
Compression:
Stored size: 647 Bytes
Contents
require 'prop/key' module Prop class Options # Sanitizes the option set and sets defaults def self.build(options) key = options.fetch(:key) params = options.fetch(:params) defaults = options.fetch(:defaults) result = defaults.merge(params) result[:key] = Prop::Key.normalize(key) result[:threshold] = result[:threshold].to_i result[:interval] = result[:interval].to_i raise RuntimeError.new("Invalid threshold setting") unless result[:threshold] > 0 raise RuntimeError.new("Invalid interval setting") unless result[:interval] > 0 result end end end
Version data entries
13 entries across 13 versions & 1 rubygems