Sha256: 32dd8895364a788f9c58c1134d8f32fa9582d4cdba47500c152e2b61d118bd86
Contents?: true
Size: 820 Bytes
Versions: 9
Compression:
Stored size: 820 Bytes
Contents
require 'cgi' module DashingContrib module Pingdom class Credentials attr_accessor :api_key, :username, :password, :team_account def initialize(options = {}) user_options = default_options.merge(options) @api_key = user_options[:api_key] || missing_args(:api_key) @password = CGI.escape(user_options[:password]) || missing_args(:password) @username = CGI.escape(user_options[:username]) || missing_args(:username) @team_account = user_options[:team_account] end private def default_options { api_key: '', password: '', username: '', team_account: '' } end def missing_args(name) raise "Pingdom credentials requires #{name.to_s}" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems