Guest User

Untitled

a guest
Nov 4th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.00 KB | None | 0 0
  1. options = Hash.new.tap do |params|
  2.                   params[:name]         = name          unless name.empty?
  3.                   params[:host]         = host          unless host.empty?
  4.                   params[:paused]       = paused        unless paused.empty?
  5.                   params[:resolution]   = resolution    unless resolution.empty?
  6.                   params[:contactids]   = contactids    unless contactids.empty?
  7.                   params[:sendtoemail]  = sendtoemail   unless sendtoemail.empty?
  8.                   params[:url]          = url           unless url.empty?
  9.                   params[:encryption]   = encryption    unless encryption.empty?
  10.         end
  11.  
  12.         puts options
  13.         result = @conn.put '/api/2.0/checks', {
  14.                                                 :checkid => checkid,
  15.                                                 :name => options[:name],
  16.                                                 :host => options[:host],
  17.                                                 :paused => options[:paused],
  18.                                                 :resolution => options[:resolution],
  19.                                                 :contactids => options[:contactids],               
  20.                                                 :sendtoemail => options[:sendtoemail],
  21.                                                 :url => options[:url]                       }
  22.                                                 #:encryption => host_scheme == 'https' ? true : false }
  23.                                                
  24.     end
Advertisement
Add Comment
Please, Sign In to add comment