Sha256: 0dd4e1243eccf15efe5e4f6a5da74ef84636c415a7b70240f723b3bc30d3b6ab

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

module Quaderno
  module Behavior
    module Deliver
  
      def self.included(base)
        base.send :include, InstanceMethods
      end
      
      module InstanceMethods
        def deliver
          party_response = api_model.get("#{api_model.base_url}/#{ api_model.subdomain }/api/v1/#{ api_model.api_path }/#{ id }/deliver.json", basic_auth: { username: api_model.auth_token })
          api_model.check_exception_for(party_response, { rate_limit: true, subdomain_or_token: true, id: true, required_fields: true })
          { limit: party_response.headers["x-ratelimit-limit"].to_i, remaining: party_response.headers["x-ratelimit-remaining"].to_i }
        end 
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quaderno-1.3.1 lib/quaderno-ruby/behavior/deliver.rb