Sha256: be4b622756e1da3608896783ef19716bffc41764cb139cd40892d7950ae90d88

Contents?: true

Size: 688 Bytes

Versions: 7

Compression:

Stored size: 688 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.url}#{ api_model.api_path }/#{ id }/deliver.json", basic_auth: { username: api_model.auth_token }, headers: self.class.version_header)
          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

7 entries across 7 versions & 1 rubygems

Version Path
quaderno-1.11.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.11.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.11.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.10.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.9.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.9.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.9.0 lib/quaderno-ruby/behavior/deliver.rb