Sha256: 513bd45706a62db386c039c3192d87f143e7d2794e8f4e9f4dda5967a79780d9
Contents?: true
Size: 988 Bytes
Versions: 3
Compression:
Stored size: 988 Bytes
Contents
# Author:: Erik Hetzner (mailto:erik.hetzner@ucop.edu) # Copyright:: Copyright (c) 2011, Regents of the University of California require 'rubygems' require 'rest-client' module Mrt module Ingest # A client for ingesting objects into a Merritt. class Client def initialize(base_uri, username=nil, password=nil) @base_uri = base_uri @username = username @password = password end # Send a request to the client. def ingest(ingest_req) return Response.new(mk_rest_request(ingest_req).execute()) end # :nodoc: def mk_rest_request(ingest_req) args = { :method => :post, :url => @base_uri, :user => @username, :password => @password, :payload => ingest_req.mk_args(), :headers => { :multipart => true } }.delete_if { |k,v| (v.nil? || v == "") } return RestClient::Request.new(args) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mrt-ingest-0.0.4 | lib/mrt/ingest/client.rb |
mrt-ingest-0.0.3 | lib/mrt/ingest/client.rb |
mrt-ingest-0.0.2 | lib/mrt/ingest/client.rb |