Sha256: 5636a0e140e1fbd82e68ce73169ad3fa0fa8505d80bde4e8a90f5916f92f5890

Contents?: true

Size: 759 Bytes

Versions: 9

Compression:

Stored size: 759 Bytes

Contents

module Quaderno
  module Behavior
    module Block
      def self.included(receiver)
        receiver.send :extend, ClassMethods
      end

      module ClassMethods
        include Quaderno::Helpers::Authentication

        def block(id, options = {})
          authentication = get_authentication(options.merge(api_model: api_model))


          response = put("#{authentication[:url]}#{api_model.api_path}/#{id}/block.json",
            basic_auth: authentication[:basic_auth],
            headers: version_header.merge(authentication[:headers])
          )

          check_exception_for(response, { rate_limit: true, subdomain_or_token: true, id: true })
          doc = response.parsed_response

          new doc
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
quaderno-1.14.0 lib/quaderno-ruby/behavior/block.rb
quaderno-1.13.2 lib/quaderno-ruby/behavior/block.rb
quaderno-1.13.1 lib/quaderno-ruby/behavior/block.rb
quaderno-1.13.0 lib/quaderno-ruby/behavior/block.rb
quaderno-1.12.5 lib/quaderno-ruby/behavior/block.rb
quaderno-1.12.4 lib/quaderno-ruby/behavior/block.rb
quaderno-1.12.3 lib/quaderno-ruby/behavior/block.rb
quaderno-1.12.2 lib/quaderno-ruby/behavior/block.rb
quaderno-1.12.1 lib/quaderno-ruby/behavior/block.rb