Sha256: 8be4a08502c5f32ef0c5c7a06b74d47ca8f3805d4776116173bff3c5dcd8a98c
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
require 'mrkt/version' require 'mrkt/errors' require 'mrkt/concerns/connection' require 'mrkt/concerns/authentication' require 'mrkt/concerns/crud_helpers' require 'mrkt/concerns/crud_campaigns' require 'mrkt/concerns/crud_leads' require 'mrkt/concerns/crud_lists' require 'mrkt/concerns/import_leads' require 'mrkt/concerns/crud_custom_objects' require 'mrkt/concerns/crud_programs' module Mrkt class Client include Connection include Authentication include CrudHelpers include CrudCampaigns include CrudLeads include CrudLists include ImportLeads include CrudCustomObjects include CrudPrograms attr_accessor :debug def initialize(options = {}) @host = options.fetch(:host) @client_id = options.fetch(:client_id) @client_secret = options.fetch(:client_secret) @options = options end %i(get post delete).each do |http_method| define_method(http_method) do |path, payload = {}, &block| authenticate! resp = connection.send(http_method, path, payload) do |req| add_authorization(req) block.call(req) unless block.nil? end resp.body end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mrkt-0.6.2 | lib/mrkt.rb |