class DashingContrib::Pingdom::Credentials

Attributes

api_key[RW]
password[RW]
team_account[RW]
username[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/dashing-contrib/bottles/pingdom/credentials.rb, line 8
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 Instance Methods

default_options() click to toggle source
# File lib/dashing-contrib/bottles/pingdom/credentials.rb, line 17
def default_options
  {
      api_key: '',
      password: '',
      username: '',
      team_account: ''
  }
end
missing_args(name) click to toggle source
# File lib/dashing-contrib/bottles/pingdom/credentials.rb, line 26
def missing_args(name)
  raise "Pingdom credentials requires #{name.to_s}"
end