Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ else
puts "it remains unzapped"
end

zapper = ZapierRuby::Zapper.new(url: standard_url)
zapper = ZapierRuby::ZapperStandard.new(url: standard_url)

if zapper.zap({hello: "world"})
puts "zapped it"
Expand Down
1 change: 1 addition & 0 deletions lib/zapier_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
require 'zapier_ruby/config'
require 'zapier_ruby/base'
require 'zapier_ruby/zapper'
require 'zapier_ruby/zapper_standard'

module ZapierRuby
class << self
Expand Down
21 changes: 21 additions & 0 deletions lib/zapier_ruby/zapper_standard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module ZapierRuby
class ZapperStandard < Base
attr_accessor :opt_hash

def initialize(opt_hash={})
self.opt_hash = opt_hash
self.logger = LoggerDecorator.new(config.enable_logging)
end

def zap(params={})
logger.debug "Zapping #{zap_url} with params: #{params.inspect}"
post_zap(params)
end

private

def zap_url
"#{opt_hash[:url]}"
end
end
end