Sha256: a11fe8d52fbb308cf5fcabc3f2f8c02f055918fa098da78fce5108004c58f8c4

Contents?: true

Size: 674 Bytes

Versions: 10

Compression:

Stored size: 674 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/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

10 entries across 10 versions & 1 rubygems

Version Path
quaderno-1.5.5 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.5.4 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.5.3 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.5.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.5.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.5.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.4.2 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.4.1 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.4.0 lib/quaderno-ruby/behavior/deliver.rb
quaderno-1.3.2 lib/quaderno-ruby/behavior/deliver.rb