class ZapierRuby::Zapper

Attributes

zap_name[RW]

Public Class Methods

new(zap_name, web_hook_id=nil) click to toggle source
# File lib/zapier_ruby/zapper.rb, line 5
def initialize(zap_name, web_hook_id=nil)
  self.zap_name = zap_name
  self.logger = LoggerDecorator.new(config.enable_logging)
  @zap_web_hook = web_hook_id if web_hook_id
end

Public Instance Methods

zap(params={}) click to toggle source
# File lib/zapier_ruby/zapper.rb, line 11
def zap(params={})
  unless zap_web_hook_id
    raise ZapierMisConfiguration, "No zap configured for #{zap_name}. Configured webhooks: #{config.web_hooks.to_s}"
  end

  logger.debug "Zapping #{zap_name} with params: #{params.to_s}"
  post_zap(params)
end