Sha256: 94b0a213bd42a61e84df8d94f14d1ddd82fcfd1e451f9b30253b4955ad04cdb3

Contents?: true

Size: 678 Bytes

Versions: 8

Compression:

Stored size: 678 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.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

8 entries across 8 versions & 1 rubygems

Version Path
quaderno-1.3.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.2.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.2.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.2.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.1.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.1.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.1.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.0.0 lib/quaderno-ruby/behavior/deliver.rb